RDFPath Proposal

This proposal was originally sent to the RDFPath list for discussion. It's a proposed format for RDFPath.

Node Queries

/
Returns all nodes.
[ ]
Returns all anonymous nodes.
[foaf:mbox "me@aaronsw.com"]
Returns all nodes where the value of the property foaf:mbox equals the literal "me@aaronsw.com".
[foaf:mbox "me@aaronsw.com" ; foaf:homepage <http://www.aaronsw.com>]
Returns nodes where foaf:mbox equals the literal of my email address and foaf:homepage equals the resource of my homepage.
[a rdf:Bag]
Returns nodes of type rdf:Bag.
<http://example.org/#foo>
Returns the resource <http://example.org/#foo>.
"Whatever"
Returns the literal "Whatever".

Sub-queries

(In these, the first path segment can be replaced with any of the node queries above.)
/dc:creator
Returns values of the dc:creator property for all resources.
/[a rdfs:ContainerMembershipProperty]
Returns the values of all container membership properties (_1, _2, etc.) for all resources.
"Aaron Swartz"\dc:creator
Returns all resources with a dc:creator property of "Aaron Swartz".

(The last one may be a bit odd, but I think it's very powerful. It allows you to go backwards in queries.)

Query Refinements

/dc:creator [a w3c:StaffMember]
Returns all of the w3c:StaffMembers who are listed as the dc:creator of a resource.

@@ fodder

I don't do arcs or reification* because I don't really grok how they fit into a query context.

Can all this be done with anonymous node queries / basic N3? cf discussion with Sandro Hawke on rdfig*.

The <uri> syntax doesn't fit well in attributes, but breaking it breaks the N3 compatibility.

Part of LogicError. Powered by Blogspace, an Aaron Swartz project. Email the webmaster with problems.