-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joel Bender wrote: > Hi, > > > I've been wrapping my head around graphs (reading > <http://rdflib.net/store/>) and I'm in a bit of a fog. Given this N3 > statement... > > :chimezie :said {:higherOrderStatements rdf:type :complicated} > > Would it look like this in TriG? > > @prefix : <> . > @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . > > { > :chimezie :said _:G . > } > _:G :- { > :higherOrderStatements rdf:type :complicated . > }
At first I thought "just try it", but then I realised that rdflib has no trig or trix serialiser. I can volunteer to write a trigwriter at some point, but it might not happen today. In general N3 has it's own idea about quoted graphs that are not the same as named graphs. An application could chose to implement n3's quoted graphs as named graph. I dont know the rdflib policy here, but if I load your data into a graph and do g.contexts() I get two things, the data graph + a bnode graph, so I would guess that IF we had a trig writer: yes, somethign like this would come out. > > Now given this SPARQL query... > > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> > SELECT ?g, ?thing > WHERE { > GRAPH ?g { > ?thing rdf:type ?thingType > } > } > > Does this return the higherOrderStatements subject? Some auto-generated > node identifier for g? In a 'formula-aware' store is there a > distinction between the named graphs and quoted statement? Is there a > way to query things inside the 'formula graph'? Since the answer to question 1 is maybe, I would guess that this works. But it doesn't. Odd. If I do maingraph.get_context( bnodeid_of_quoted_graph ) and query this graph I get "AttributeError: 'BNode' object has no attribute 'identifier'" So I guess rdflib DOES have a distinction between the two. I started this reply thinking I had all the answers, but found I was wrong in all my assumptions :) Sorry. So I have no idea about the last one either. Or rather, doing it from python is easy, but from sparql I dont know. Hopefully someone else can shed some light on some of these issues? - - Gunnar -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGldQufD15aMgAOfcRAitrAKDOeGRpgRussOdDaGY5ZQ0E9/s1+QCfQrry GxeZ2brpnRYcjq5D7JHfWlk= =Sk7y -----END PGP SIGNATURE----- _______________________________________________ Dev mailing list Dev@rdflib.net http://rdflib.net/mailman/listinfo/dev