I'm making an automatic instanctiation of an ontology. let says Person with his subclass FEMALE and MALE.

enter image description here

During the instanciation, I used can create instances of the class FEMALE and MALE.

for example

OntModel model = // Jena model
String   NS    = // the name space

person0 = model.createIndividual(NS + "Allison", "FEMALE");

How could I add the fact that Allisson in person0 is also an individual of the class PERSON.

I know that a reasoner (Pellet for example) could help here but. but in my case there is a huge number of individuals to instanciate, so the reasoning step become too long for me (about more than 10 hours)

thanks for any help !

asked 08 Nov '12, 07:56

FOPA%20L%C3%A9on%20Constantin's gravatar image

FOPA Léon Co...
accept rate: 0%

edited 08 Nov '12, 08:00

I don't exactly understand the problem, and in my opinion such framework related questions should be asked on the corresponding mailing list(if such exist) but anyway:

Every time you create an individual you would also have to assert it to all superclasses, which I guess you could get by inference. Maybe you can use the method

Individual::addOntClass(Resource cls)
permanent link

answered 08 Nov '12, 10:50

AKSWMember's gravatar image

accept rate: 25%

edited 08 Nov '12, 10:50

Depending on your model size, using a reasonner may be very time consuming. For some of my developments, I had to avoid using a reasonner. Instead of that, I have run a SPARQL CONSTRUCT query to manage adding the new "infered" triples.

like @AKSWMember said, if your need is only to assert that an individual from FEMALE is also an individual of PERSON, you could assert 2 rdf:type to the same ressource.

permanent link

answered 09 Nov '12, 05:11

Bric_e's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 08 Nov '12, 07:56

question was seen: 2,021 times

last updated: 09 Nov '12, 05:11