- From: Sean B. Palmer <sean@mysterylights.com>
- Date: Fri, 9 Nov 2001 16:45:53 -0000
- To: <www-rdf-rules@w3.org>
- Cc: "Dan Brickley" <danbri@w3.org>
> First, I'd love to know what people have been building... My turn... Aaron Swartz and I have been working on the beginnings of an RDF API written in Python, and we have written a query component (Gofyniad). It's a simple query engine, viz. it takes triples out of the store once it has matched them. http://lists.w3.org/Archives/Public/www-archive/2001Oct/att-0040/01-go fyniad => http://cvs.plexdev.org/viewcvs/viewcvs.cgi/plex/plex/plexrdf/query.py (1.1) You'll need RDF API to run it (which is only about 2KB):- http://cvs.plexdev.org/viewcvs/viewcvs.cgi/plex/plex/plexrdf/rdfapi.py (1.4) and we have an NTriples parser as well:- http://cvs.plexdev.org/viewcvs/viewcvs.cgi/plex/plex/plexrdf/ntriples. py (1.6) Bijan Parsia gave a critique of the Query engine on RDF IG:- http://ilrt.org/discovery/chatlogs/rdfig/2001-10-30.txt To make it run:- python query.py input.nt query.nt > out.nt The query format is actually an extended NTriples, with ?x, ?y etc. being universally quantified variables. Example query:- input.nt:- [[[ <#Sean> <#likes> <#TheSimpsons> . <#Sean> <#likes> <#SemanticWeb> . <#Sean> <#name> "Sean" . ]]] query.nt:- [[[ <#Sean> <#likes> ?x . ]]] out.nt:- [[[ @prefix : <tag:infomesh.net,2001-08-07:> . @prefix rdfs: <http://www.w3.org/2001/01/rdf-schema#> . :Result rdfs:subClassOf rdfs:Resource . { <rdfapi.Node instance at 007CA9BC> = #TheSimpsons . } a :Result . <#Sean> <#likes> <#TheSimpsons> . { <rdfapi.Node instance at 007CA82C> = #SemanticWeb . } a :Result . <#Sean> <#likes> <#SemanticWeb> . ]]] as you can tell, we need to tweak the output function a little bit, but the meat of the thing is done. Cheers, -- Kindest Regards, Sean B. Palmer @prefix : <http://webns.net/roughterms/> . :Sean :hasHomepage <http://purl.org/net/sbp/> .
Received on Friday, 9 November 2001 11:46:24 UTC