Add person to owl file using Jena

I have an OWL file named Modeling.owl, generated with Protege 4.2. But then I have to change it by registering some new Individual and its properties using Yen. For example, I have a Class Model, I have to add Individual for this class. Does anyone know and it would be nice if you could give some example code. I tried looking for a tutorial, but unfortunately I didn't find a comprehensive one.

thank

+3


source to share


1 answer


JENA Tutorial - http://jena.apache.org/documentation/ontology/index.html

// create the reasoning model using the base
OntModel inf = ModelFactory.createOntologyModel( OWL_MEM_MICRO_RULE_INF, base );

// create a dummy paper for this example
OntClass paper = base.getOntClass( NS + "Paper" );
Individual p1 = base.createIndividual( NS + "paper1", paper );

      



This is an excerpt from a more detailed explanation (about half way).

+2


source







All Articles