From: <hen...@ya...> - 2005-04-24 19:31:48
|
Not sure if this problem I am having is obvious - I hope it is! What I would like to do is: --------------- given an RDFS ontology (and later, OWL) I would like to be able to easily create get, set, delete, and update functions - so that for any class, their properties and inherited properties become part of simple php functions to serve as APIs for other applications. --------------- Problem: If you create an RDFS class like "Person" - then you want to create instances using the statement and resource API of RAP it appears that instead of the desired < ns:Person about="ns:person1" ns:hasTeeth=14> </person> < ns:Person about="ns:person2" ns:hasTeeth=14> </person> Using the statement api I ended up with one, completely incorrect instance of a person < ns:Person about="ns:Person"> <ns:hasTeeth =14 /> <ns:hasTeeth =14 /> </Person> I also ended up with unneeded(?) <Description... > tags. The ontology model looks like it understands classes and properties - but I am reluctant to use the RAP ontology model because it looks to be incomplete. RDFS example file: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE rdf:RDF [ <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <!ENTITY hendler3 'http://www.somewhere.net/hendler3#'> <!ENTITY rdfs 'http://www.w3.org/TR/1999/PR-rdf-schema-19990303#'> ]> <rdf:RDF xmlns:rdf="&rdf;" xmlns:hendler3="&hendler3;" xmlns:rdfs="&rdfs;"> <rdfs:Class rdf:about="&hendler3;Mammal" rdfs:comment="A mamal" rdfs:label="Mammal"> <rdfs:subClassOf rdf:resource="&rdfs;Resource"/> </rdfs:Class> <rdfs:Class rdf:about="&hendler3;Person" rdfs:comment="a person" rdfs:label="Person"> <rdfs:subClassOf rdf:resource="&hendler3;Mammal"/> </rdfs:Class> <rdf:Property rdf:about="&hendler3;hasName" rdfs:comment="has name" rdfs:label="hasName"> <rdfs:domain rdf:resource="&hendler3;Person"/> <rdfs:range rdf:resource="&rdfs;Literal"/> </rdf:Property> <rdf:Property rdf:about="&hendler3;hasTeeth" rdfs:comment="has teeth" rdfs:label="hasTeeth"> <rdfs:domain rdf:resource="&hendler3;Mammal"/> <rdfs:range rdf:resource="&rdfs;Literal"/> </rdf:Property> </rdf:RDF> Desired RDF <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE rdf:RDF [ <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <!ENTITY hendler3 'http://www.somewhere.net/hendler3#'> <!ENTITY rdfs 'http://www.w3.org/TR/1999/PR-rdf-schema-19990303#'> ]> <rdf:RDF xmlns:rdf="&rdf;" xmlns:hendler3="&hendler3;" xmlns:rdfs="&rdfs;"> <hendler3:Mammal rdf:about="&hendler3;Doggy" hendler3:hasTeeth="14" rdfs:label="14"/> <hendler3:Person rdf:about="&hendler3;Jonathan" hendler3:hasName="Jonathan" hendler3:hasTeeth="28" rdfs:label="28"/> <hendler3:Person rdf:about="&hendler3;Sonia" hendler3:hasName="Sonia" hendler3:hasTeeth="27" rdfs:label="27"/> </rdf:RDF> |