On 16/04/13 12:18, aarthi wrote:
ok........  thanksfor your reply lan...  i will read the content.  but i
need to create the relation between two ontologies.
That's not what you said, and, indeed, I think it's not what your example states.

consider ont1 and ont2
are the two ontologies.
OK. But consider what you mean by "the ontology" in an RDF/OWL context. The _open world assumption_ means that you never have a closed set of triples that you can that these, and only these, triples are the contents of a given ontology. Specifically, if by 'ontology' you mean the namespace http://example.org/ontologies/ont1# or whatever, the open world assumption means that any classes defined within that namespace in a given ontology document - say

http://example.org/ontologies/ont1.owl

cannot be considered to be the *only* classes in that namespace and hence 'in' that ontology.

if both ont1 and ont2 have a class named employee.
OK

And employee class in ont1 have a subclass named john.
Wait, what? How is a person a sub-class of employee? I think you mean that john is an *instance* of an employee. Sub-classes are like subsets: so sub-classes of employee might be 'managers', 'dev-ops', 'interns', etc.

but ont2's employee class doesn't have that class.
Sorry, but I don't know what this means.

i need to specify a relation that john
"is-a" subclass of ont2's employee class.
But john isn't a sub-class of ont2:employee, any more than he is a sub-class of ont1:employee. However, he could be an instance of an employee in the other ontology.

how to do that using jena? is it possible?
There are various ways you could do this.

Just to be clear, suppose we have:

    ont1:Employee a owl:Class .
    ont2:Employee a owl:Class .
    ex:john rdf:type ont1:Employee .

You could just directly assert that john is also an ont2:Employee. This may be true, but (i) it doesn't scale ... suppose you have thousands of employees to update, and (ii) it doesn't tell you anything about the relationship between the two Employee classes. Still, it's straightforward, you just add the triple

   ex:john rdf:type ont2:Employee .

Alternatively, suppose that it is the case that every ont1:Employee is also an ont2:Employee. We can state that:

  ont1:Employee rdfs:subClassOf ont2:Employee .

and via the reasoner, this will *entail*

   ex:john rdf:type ont2:Employee .

The converse is not true - if every ont2:Employee is also an ont1:Employee, it does not allow us to conclude anything new about john.

I've hacked up some quick code illustrating this in a gist:

https://gist.github.com/ephemerian/5395756

Ian

Reply via email to