Hello,
I managed to establish a connection to my MYSQL database via Jena SDB and
inserted some triples.

However, I still feel insecure how OWL constructs are persisted with Jena.

Here is my Java code example:
c.initSdb(OntModelSpec.OWL_MEM_MICRO_RULE_INF); //connect to MYSQL db
OntModel base = c.getOntologyModel();

String SOURCE = "http://www.eswc2006.org/technologies/ontology";;
String NS = SOURCE + "#";

/* Add 2 individuals of the type "paper" linked via an object property */
OntClass paper = base.getOntClass( NS + "Paper" );
Individual p1 = base.createIndividual( NS + "paper1", paper );
Individual p2 = base.createIndividual( NS + "paper2", paper );
Property hasLinkTo = base.createObjectProperty(NS + "hasLinkTo"); //
hasName property
base.add(p1,hasLinkTo,p2);

 ---
In the database 4 nodes, viz.

   - http://www.w3.org/1999/02/22-rdf-syntax-ns#type
   - http://www.eswc2006.org/technologies/ontology#hasLinkTo
   - http://www.w3.org/2002/07/owl#ObjectProperty
   - http://www.eswc2006.org/technologies/ontology#paper1

and 2 triples, viz.

   - #hasLinkTo - rdf-syntax-ns#type - owl#ObjectProperty
   - #paper1 - #hasLinkTo - #paper1

are persisted.
My question is: Shouldn't the OntClass "Paper" result in an additional
node, and an additional triple in the database?
Or do I have to add this manually? How? I looked at the Jena tutorial but
couldn't find an example.

Best regards and thank you very much,
Andreas

Reply via email to