Hi Dave, 

that's looks like what I need, except I don't know how to write it down. At the 
moment I do

OntModel model = ModelFactory.createOntologyModel();


What should I write instead?

( Note: When trying: 

OntModel model = ModelFactory.createOntologyModel(OntModelSpec spec, Model 
base);

Java complains it can't resolve variables / recognize tokens. )

Cheers, Jos



-----Ursprüngliche Nachricht-----
Von: Dave Reynolds [mailto:[email protected]] 
Gesendet: Dienstag, 17. Januar 2017 15:18
An: [email protected]
Betreff: Re: Listing only asserted propeties Vs filtering property lists



On 17/01/17 13:02, Jos Lehmann wrote:
> Hi there
>
> I am copying Classes and/or Instances as well as their properties from one 
> ontology to another.
>
> To get the list of Classe and/or Instance properties from the source 
> ontology I use listProperties()
>
> But this gives much more than I need: i.e. superproperties, as well as other 
> stuff, which clutters my copy ontology.
>
> I have tried to filter out undesired properties by recursive while calls on 
> Next(), or by trying to find a cut-off in the property list. But these 
> solutions are not general enough.
>
> I would like to just get the asserted properties when querying the source 
> ontology. Is that possible?

Sounds like you have an OntModel with inference, create one without inference 
or access the baseModel (bypassing the inference).

In the absence of any inference then Resource#listProperties will just list the 
asserted properties (irrespective of what type of property).

Dave

Reply via email to