You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Simon Gray <si...@hum.ku.dk> on 2021/09/23 14:18:43 UTC

How to separate Ontology triples from Instance triples?

Hi there,

Overall really satisfied with Apache Jena!

I’m currently constructing an OntModel based on an OntModelSpec which first calls OntModel.read(“…”) a bunch of times to load the schemas, adding the base triple data to the graph afterwards. I have successfully managed to get it to infer new triples from the base triples based on the OWL schemas (mostly by way of owl:inverseOf).

Now I would like to export this new, expanded dataset. However, the base model does NOT seem to include the inferred triples, while the full OntModel DOES include them... but it includes all of the schemas too. How do I get the just base model + the inferred triples without the schema data mixed in?

Kind regards,
Simon Gray

Research Officer,
Centre for Language Technology,
University of Copenhagen

Re: How to separate Ontology triples from Instance triples?

Posted by Marc Agate <ag...@gmail.com>.
You might want to use a named graph for the model you want to export...

Marc

Le 23/09/2021 à 16:18, Simon Gray a écrit :
> Hi there,
>
> Overall really satisfied with Apache Jena!
>
> I’m currently constructing an OntModel based on an OntModelSpec which first calls OntModel.read(“…”) a bunch of times to load the schemas, adding the base triple data to the graph afterwards. I have successfully managed to get it to infer new triples from the base triples based on the OWL schemas (mostly by way of owl:inverseOf).
>
> Now I would like to export this new, expanded dataset. However, the base model does NOT seem to include the inferred triples, while the full OntModel DOES include them... but it includes all of the schemas too. How do I get the just base model + the inferred triples without the schema data mixed in?
>
> Kind regards,
> Simon Gray
>
> Research Officer,
> Centre for Language Technology,
> University of Copenhagen