Hi Holger, thanks for pointing out the jena API. Yes, this programmatic approach works. I was wondering whether there would be a way to solve this without using jena API. It seems that using API is the best way to do.
You state the latter didn't quite work, but what error did you get? -> replacing imports triples with file URIs as a post-processing step did work well. Thanks a lot for your help. Regards, Kai On Friday, 27 May 2022 at 04:00:12 UTC+2 Holger Knublauch wrote: > Hello Kai, > On 2022-05-27 5:43 am, Kai Liu wrote: > > Thanks for the links and the info. > > I was talking about the EDG 7.2 feature "Commit Ontology to Git > Repository". We found this feature extremely useful, and it saved us lots > of tedious work of exporting, copying and renaming TTL files. With this > feature, the "External Graph URI" of included sub-graph is not > automatically persisted in the including sub-graph, however. > > Back to the origin of my question: I need to find a way to resolve > <urn:x-evn-master:b> to a local file b.ttl, which was exported to the same > directory as a.ttl in the git repository. I need to run the SHACL validator > (https://github.com/TopQuadrant/shacl), which can not understand > "*<urn:x-evn-master:a> > owl:imports <urn:x-evn-master:b>*", but does understand > "*<urn:x-evn-master:a> > owl:imports <file:b.ttl>*" . This is why I was thinking of populating an > additional triple to import <file:b.ttl>. This might just be a workaround > though. > > If you are running the SHACL API programmatically, there are various ways > in which you can redirect owl:imports. For example using something like > (untested) > > ontDocumentManager.addAltEntry("urn:x-evn-master:a", > "file:///c:/a.ttl") > > inserted into some place like > > > https://github.com/TopQuadrant/shacl/blob/master/src/main/java/org/topbraid/shacl/tools/AbstractTool.java#L76 > > Or just replace the owl:imports triples with file URIs as above. You state > the latter didn't quite work, but what error did you get? > > But these are more Jena API questions than TopBraid questions. > > Holger > > > > It would be much appreciated if you could provide some suggestion about > how to resolve <urn:x-evn-master:b> to a local file b.ttl, such that the > external SHACL validator can run through without changing the persisted TTL > files by the EDG git feature. > > Thanks. > > Regards, Kai > > On Thursday, 26 May 2022 at 16:06:15 UTC+2 David Price wrote: > >> Hi, >> >> Forgot to mention that in Settings in each collection there is this: >> >> External Graph URI >> >> The external graph URI is an optional alias for the asset collection >> identifier, used when exporting an asset collection as serialized RDF >> graph. It can also be used on import of interconnected RDF files when they >> are loaded into different asset collections - to appropriately re-route >> their owl:imports references. >> >> Cheers, >> David >> >> >> >> On 26 May 2022, at 12:06, Kai Liu <[email protected]> wrote: >> >> Hi, >> >> I have now a requirement to automatically add "owl:imports" lines for >> all turtle file persisted in git repository. For example: >> >> The asset colletion "a" includes the asset collection "b", and the >> resulting a.ttl in the git repository has the following triple: >> >> <urn:x-evn-master:a> owl:imports <urn:x-evn-master:b>. >> >> I'd like to add an additional triple automatically: >> >> <urn:x-evn-master:a> owl:imports <file:b.ttl>. >> >> This should be done for all included asset collections. Could you please >> suggest me how to do that? What script should be adapted and how? Thanks. >> >> Regards, Kai >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "TopBraid Suite Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/topbraid-users/18111a21-b9db-4574-8f62-053fc36d83ben%40googlegroups.com >> >> <https://groups.google.com/d/msgid/topbraid-users/18111a21-b9db-4574-8f62-053fc36d83ben%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> >> UK +44 (0) 7788 561308 <+44%207788%20561308> >> US +1 (336) 283-0808 <(336)%20283-0808> >> >> -- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/6716f6b5-49a6-4791-aa46-91bf58ae5a93n%40googlegroups.com > > <https://groups.google.com/d/msgid/topbraid-users/6716f6b5-49a6-4791-aa46-91bf58ae5a93n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/812c3ac1-aef1-4143-a86d-08ada9d7f487n%40googlegroups.com.
