[Pellet-users] how to fetch individuals with certain properties

robert davey (JIC) robert.davey at bbsrc.ac.uk
Sun Jun 8 16:14:51 UTC 2008


Hi Alex,

You can create OWLDescriptions from any implementing class, such as OWLRestriction:

OWLDataFactory factory = OWLManager.createOWLOntologyManager().getOWLDataFactory();
OWLDataProperty dataprop = factory.getOWLDataProperty("http://ontology/uri#hasTag");
OWLConstant constant = factory.getOWLTypedConstant("test", "http://www.w3.org/2001/XMLSchema#string");
OWLRestriction restriction = factory.getOWLDataValueRestriction(dataprop, constant);

I'm pretty sure there are some examples of how to do this in the OWLAPI examples...

http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl1_1/trunk/examples/src/main/java/org/coode/owlapi/examples/Example7.java

Cheers

Rob

---------------------------------------
Dr. Rob Davey
NCYC / Institute of Food Research
Computational Biology / John Innes Centre
Norwich Research Park
Norwich, Norfolk, NR4 7HU

Tel IFR : +44 (0)1603 251449 / x1449
Tel JIC : +44 (0)1603 450833 / x2833
Web     : http://cbr.jic.ac.uk/dicks/
---------------------------------------



-----Original Message-----
From: pellet-users-bounces at lists.owldl.com on behalf of trennung at weinenvorglueck.de
Sent: Sat 6/7/2008 4:55 PM
To: pellet-users at lists.owldl.com
Subject: [Pellet-users] how to fetch individuals with certain properties
 
Hello!

I want to get all individuals, that have some properties.
They must have one of these: hasTag, startswith or endswith. hasTag is an 
OWLDataProperty, as I get (with some others) via: Set<OWLDataProperty> 
my_dprops = reasoner.getDataProperties();

Is it possible, to create an OWLDescription and get all matching individuals 
like that:
[code]
OWLDescription clsC = new OWLDescription(); // OWLDescription is abstract, 
doesn't work that way.
        
        // public Set<OWLIndividual> getIndividuals(OWLDescription clsC, 
boolean direct)
        Set<OWLIndividual> results = reasoner.getIndividuals(clsC, false);
[/code]

If so, my primary question is: how do I create the OWLDescription?

best regards, Alex
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
_______________________________________________
Pellet-users mailing list
Pellet-users at lists.owldl.com
http://lists.owldl.com/mailman/listinfo/pellet-users
_______________________________________________

Sponsored by Clark & Parsia, LLC http://clarkparsia.com/



More information about the Pellet-users mailing list