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...
776
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)
link

answered 08 Nov '12, 10:50

AKSWMember's gravatar image

AKSWMember
1.4k28
accept rate: 24%

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.

link

answered 09 Nov '12, 05:11

Bric_e's gravatar image

Bric_e
314
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

By RSS:

Answers

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

Tags:

×851
×592
×578

Asked: 08 Nov '12, 07:56

Seen: 996 times

Last updated: 09 Nov '12, 05:11