I have a graph, and in this graph I have a list like this:
:Michelangelo :representativeFor :Italy;
rdfs:label "Michelangelo di Ludovico Buonarroti Simoni";
:birthInfo [:date "1475-03-10"^^xsd:date; :place :Florence];
:sculptorOf [a rdf:List; rdf:first :Pieta; rdf:rest [a rdf:List; rdf:first :David; rdf:rest [a rdf:List; rdf:first :TheLastJudgement; rdf:rest rdf:nil]]];
:sculptorOf rdfs:domain :Sculptor; rdfs:range :Sculpture.
When I put this query
select *
where {:David a ?z}
I expect to get resourse and Sculpture. I don't understand why is not working , what should I do ?
Your title is how to insert a list in rdf, but it looks like you're trying to query where your values in the query are in the list in the data.
If I understand you correctly, you want to find David's types based on:
and the domain and range axioms:
This isn't how RDF and OWL work. Michaelangelo didn't sculpt a list of things, he sculpted different things. In RDF, you'd represent this as:
That's shorthand for three triples:
Now, if you have OWL inference enabled, you'll be able to infer that since David is the object of a sculptorOf assertion, David must have the type Sculpture. If RDF(S) inference is available, you'll also be able to infer that David is an rdfs:Resource.