semsol / arc2

ARC RDF Classes for PHP
Other
332 stars 89 forks source link

How is the support for RDF lists? (SPARQL) #93

Closed k00ni closed 3 weeks ago

k00ni commented 6 years ago

Hi, is ARC2 able to handle RDF lists such as the following?

ex:OrConstraintExampleShape
    sh:or (
    [
        sh:path ex:firstName ;
        sh:minCount 1 ;
    ]
    [
        sh:path ex:lastName ;
        sh:minCount 1 ;
    ]
        [
        sh:path ex:givenName ;
        sh:minCount 1 ;
    ]
    ) .
k00ni commented 6 years ago

ARC2 seems to find elements of a list, but it is not able to select a particular element using SPARQL:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT * FROM <https://pier-and-peer.com/ns/backbone/model/> WHERE {
    _:b2146255164_b1 rdf:first ?item.
    ?item ?p ?o.
}

It outputs

item p o
_:b3873706118_b1 http://www.w3.org/ns/shacl#path http://xmlns.com/foaf/0.1/firstName
_:b3873706118_b1 http://www.w3.org/ns/shacl#minCount 1
_:b149582250_b3 http://www.w3.org/ns/shacl#path http://xmlns.com/foaf/0.1/givenName
_:b149582250_b3 http://www.w3.org/ns/shacl#minCount 1

but i rather want

item p o
(some blank 1) sh:path ex:firstName
(some blank 1) sh:minCount 1