Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Beginner EODM question
Beginner EODM question [message #571601] Thu, 09 March 2006 02:58
Eclipse UserFriend
Originally posted by: glenn.everitt.gmail.com

I think what I want to do is:

1. load an existing owl ontology
2. create a series of statements add them to the model
3. execute a couple of queries against the model (SPARQL queries?)

I downloaded the IODT toolkit from IBM alphaworks and I think the
LoadAndSaveOwlbyOWLFile shows me how to load and parse and owl document into
an owl ontology. (Please correct me if I am using terms incorrectly.)

OWLParser parser = new OWLParserImpl();

//New an OWL Document
OWLDocument food = new OWLDocumentImpl("./testcase/food.owl", null,
true);

//Add the document into the parser
parser.addOWLDocument(food);

//Start to parse OWL documents and get OWL ontologies
OWLOntology ontofood = parser.parseOWLDocument(food);

Now I want to add a statement

//create some RDF statement
RDFSFactory rdfsFactory = RDFSFactory.eINSTANCE;

RDFSResource subjectResource =
rdfsFactory.createRDFSResource(ontofood , subjectURI);

RDFProperty subjectProperty = rdfsFactory.createRDFProperty(ontofood
, predicateURI);

RDFSLiteral literal = rdfsFactory.createRDFSLiteral(ontofood ,
objectStringLiteral);

RDFStatement statement = rdfsFactory.createRDFStatement(ontofood ,
subjectResource, subjectProperty, literal);

Now is statement already in the ontofood ontology?

How would I go about writing a query to find the all subjectResource items
with the same subjectProperty?

Thanks for any help - Glenn
Previous Topic:Newbie: documentation of how to use validation ?
Next Topic:Newbie: documentation of how to use validation ?
Goto Forum:
  


Current Time: Sat Oct 01 08:15:54 GMT 2022

Powered by FUDForum. Page generated in 0.01734 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top