Other interesting proposals:
- Aggregate functions: such as COUNT etc.
- Accessing RDF lists: it is currently impossible to express “a list that has a member that matches pattern P”.
- Query References to Blank Nodes in the Data: even though a blank node ID b is not stable, it can be expressed as the pseudo-URI _:b. During a single session, it would be quite handy if one could use these pseudo-URIs like normal URIs.
- Full-text search: Proposal to adapt XQuery full-text extensions to SPARQL.
- Project expressions: The values in the columns can be the result of an expression and not just a single variable.
- A way to get matches that are only in the default graph. One can do graph-based restriction, but only for named graphs. That is, the variable involved in the GRAPH construct always has to be bound. A work-around that I use in Hyena is to look for matches in all graphs and then exclude a match if it also appears in a named graph.
- A more object-oriented way of returning query results. That is, one should be able to return one resource per row, where some columns (“all values of rdf:type”) contain multiple values (are in non-first normal form). LIMIT per resource mentions this feature, but does not go into detail.
Query: all subjects that *only* exist in the default graph.
A simpler version would be (where one does not have to write the same pattern twice which quickly becomes cumbersome with larger patterns):SELECT DISTINCT ?subj
WHERE {
?subj ?pred ?obj .
OPTIONAL {
GRAPH ?__graph__ {
?subj ?pred ?obj .
}
}
FILTER( !bound(?__graph__) )
}
SELECT DISTINCT ?subj
WHERE {
GRAPH ?__graph__ { ?subj ?pred ?obj . }
FILTER( !bound(?__graph__) )
}
ليست هناك تعليقات:
إرسال تعليق