- From: Michael Schneider <schneid@fzi.de>
- Date: Tue, 22 Jun 2010 18:24:57 +0200
- To: "Paul Gearon" <gearon@ieee.org>, "mihir sanghavi" <ms478@njit.edu>
- Cc: <jena-dev@proxy1.groups.fy3.b.yahoo.com>, <public-owl-dev@w3.org>, <fa2260@columbia.edu>
Paul Gearon wrote: >Hi, > >Discussion at the end... > >On Mon, Jun 21, 2010 at 2:54 PM, mihir sanghavi <ms478@njit.edu> wrote: >> ---------- Forwarded message ---------- >> From: <fa2260@columbia.edu> >> Date: Mon, Jun 21, 2010 at 5:38 PM >> Subject: Re: How to handle predicates and anonymous inferred classes >created >> in protege via JENA? >> To: mihir sanghavi <ms478@njit.edu> >> >> >> Hey Folks, >> >> I am developing a semantic web application that helps navigate >biological >> hierarchies. The ontology is modelled in protege. I am having problems >> parsing the Protege generated .owl file. >> >> As an example. I modeled the relationship, "AdventititiousRoot >isPartOf only >> Root" (isPartOf is a user-defined porperty). I modeled/described this >> relationship under the 'SuperClass' field for the Class >'AdeventitiousRoot'. >> The 'Class Usage' generated was "AdventitiousRoot subClassOf isParOf >only >> Root". The associated rdf/xml code is given below. >> >> <!-- >> >http://www.semanticweb.org/ontologies/2010/1/3/PlantEntities.owl#Adventi >tousRoot >> --> >> >> <owl:Class rdf:about="#AdventitousRoot"> >> <rdfs:subClassOf rdf:resource="&owl;Thing"/> >> <rdfs:subClassOf> >> <owl:Restriction> >> <owl:onProperty rdf:resource="#isPartOf"/> >> <owl:allValuesFrom rdf:resource="#Root"/> >> </owl:Restriction> >> </rdfs:subClassOf> >> </owl:Class> >> >> I parsed this code using JENA's object "statement iterator" and I got >> triples such as "AdventitiiousRoot subClassOf Thing" and >"AdventitiousRoot >> subclassOf 6b8720b3:128d06ed301:-7fc6". >> >> I am able to capture the Subject, Predicate and Object in the first >> statement. >> >> My problem is how do I capture the predicate "isPartOf" and the owl >> restriction "only" and avoid generating the hexadecimal reference in >the >> second statement? > >(I'll follow your lead, and skip the domain prefixes for clarity) > >I think you need to understand the RDF structure that you have here. > >The RDF/XML above is describing AdventitousRoot as a subClassOf the >resource called Thing, and also as a subClass of another resource that >is a Restriction. This Restriction resource has no name, and hence it >is represented with a blank node. Identifier or not, the system needs >to have some kind of internal representation to uniquely identify this >resource, so it has generated one. This is the reason for the >hexadecimal label that you see. > >The unnamed Restriction resource has two further properties which >describe how it does restrictions. It uses the onProperty property to >describe that it restricts the isPartOf predicate, and it uses the >allValuesFrom property is restrict isPartOf to just refer to resources >of type Root. > >Everything here is perfectly correct RDF representation of an OWL >class. Apparently, you don't like the fact that your Restriction class >has no identifier. The way around it would be to give it a name. >That's valid RDF, though I can't say if there's a problem in OWL (can >someone enlighten me please? I *think* it's fine, right?). It depends on what you mean by a "name" here, and on what you mean by "OWL" here :). In the RDF serialization of OWL (2) DL, the "root node" of a property restriction is always a bNode, see Table 13 in [1]. If you put there a URI instead, then the mapping is formally undefined. I don't know how actual tools handle such cases, though, but parsing may fail. Anyway, the standard way to provide a "name" for a property restriction is via a class equivalence axiom: ex:MyRestriction owl:equivalentClass _:x . _:x rdf:type owl:Restriction . _:x owl:onProperty ex:p . _:x owl:allValuesFrom ex:C . In OWL Full, you can use a URI instead of the bNode. Or even, if you like, associate a URI with the bNode via owl:sameAs. Michael [1] <http://www.w3.org/TR/2009/REC-owl2-mapping-to-rdf-20091027/> >Also, >Protege may not deal with the name correctly (it may ignore it... I >don't know). > >Anyway, the provide the Restriction with a name, you only need to add >an rdf:about. The following uses the name AdventitousRestriction in >the same domain as AdventitousRoot: > > ><owl:Class rdf:about="#AdventitousRoot"> > <rdfs:subClassOf rdf:resource="&owl;Thing"/> > <rdfs:subClassOf> > <owl:Restriction rdf:about="#AdventitousRestriction"> > <owl:onProperty rdf:resource="#isPartOf"/> > <owl:allValuesFrom rdf:resource="#Root"/> > </owl:Restriction> > </rdfs:subClassOf> ></owl:Class> > > >Regards, >Paul Gearon -- Dipl.-Inform. Michael Schneider Research Scientist, Information Process Engineering (IPE) Tel : +49-721-9654-726 Fax : +49-721-9654-727 Email: michael.schneider@fzi.de WWW : http://www.fzi.de/michael.schneider ======================================================================= FZI Forschungszentrum Informatik an der Universität Karlsruhe Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe Tel.: +49-721-9654-0, Fax: +49-721-9654-959 Stiftung des bürgerlichen Rechts, Az 14-0563.1, RP Karlsruhe Vorstand: Prof. Dr.-Ing. Rüdiger Dillmann, Dipl. Wi.-Ing. Michael Flor, Prof. Dr. Dr. h.c. Wolffried Stucky, Prof. Dr. Rudi Studer Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus =======================================================================
Received on Tuesday, 22 June 2010 16:25:31 UTC