Examples

Get all entities

PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#>
        PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT ?entityType ?identity
        WHERE {
        ?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.api.entity.Entity>.
        ?entity rdf:type ?entityType.
        ?entity ns0:identity ?identity.
        }

Get entities of a given type

PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#>
        PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT ?identity
        WHERE {
        ?entity rdf:type <urn:polygene:type:org.apache.polygene.rest.TestEntity>.
        ?entity ns0:identity ?identity.
        }

Get entities with a given property value

PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#>
        PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        SELECT DISTINCT ?identity
        WHERE {
        ?entity rdf:type <urn:polygene:type:org.apache.polygene.rest.TestEntity>.
        ?entity ns0:identity ?identity.
        ?entity <urn:polygene:type:org.apache.polygene.rest.Named#name> "Foo bar"
        }