File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -4569,16 +4569,22 @@ protected function _compactIri(
4569
4569
return $ iri ;
4570
4570
}
4571
4571
4572
- // term is a keyword, default vocab to true
4572
+ $ inverse_ctx = $ this ->_getInverseContext ($ active_ctx );
4573
+
4573
4574
if (self ::_isKeyword ($ iri )) {
4574
- $ relative_to ['vocab ' ] = true ;
4575
- } else if (!isset ($ relative_to ['vocab ' ])) {
4575
+ // a keyword can only be compacted to simple alias
4576
+ if (property_exists ($ inverse_ctx , $ iri )) {
4577
+ return $ inverse_ctx ->$ iri ->{'@none ' }->{'@type ' }->{'@none ' };
4578
+ }
4579
+ return $ iri ;
4580
+ }
4581
+
4582
+ if (!isset ($ relative_to ['vocab ' ])) {
4576
4583
$ relative_to ['vocab ' ] = false ;
4577
4584
}
4578
4585
4579
4586
// use inverse context to pick a term if iri is relative to vocab
4580
- if ($ relative_to ['vocab ' ] &&
4581
- property_exists ($ this ->_getInverseContext ($ active_ctx ), $ iri )) {
4587
+ if ($ relative_to ['vocab ' ] && property_exists ($ inverse_ctx , $ iri )) {
4582
4588
$ default_language = '@none ' ;
4583
4589
if (property_exists ($ active_ctx , '@language ' )) {
4584
4590
$ default_language = $ active_ctx ->{'@language ' };
You can’t perform that action at this time.
0 commit comments