In my RDF store I have the following triples
For schema:
ex:animal rdf:type rdf:Class;
rdfs:subClassof ex:Package_animal.
ex:height rdf:type rdf:Property;
rdfs:label "height";
rdfs:domain ex:animal.
ex:age rdf:type rdf:Property;
rdfs:label "age";
rdfs:domain ex:animal.
ex:NumberOfLegs rdf:type rdf:Property;
rdfs:label "NumberOfLegs";
rdfs:domain ex:animal.
For instances:
ex:dog rdf:type ex:animal;
ex:height "10";
ex:age "2";
ex:NumberOfLegs "4".
ex:cat rdf:type ex:animal;
ex:height "10";
ex:age "3";
ex:NumberOfLegs "4".
I want to:
- Get properties of class
ex:animal
ex:height
ex:age
ex:NumberOfLegs
- Get the instance ex:dog of class
ex:animal
with all of its properties
ex:dog rdf:type ex:animal
ex:dog ex:height "10"
ex:dog ex:age "2"
ex:dog ex:NumberOfLegs "4"
- The SPARQL I thought was:
SELECT ?s
WHERE
{
?p rdf:type rdf:Property.
?s ?p ?y.
?s rdf:type ex:dog.
}