gkellogg / rdf_context

Ruby RDF package with contextual graphs, memory and persistent datastores and compliant RDF/XML, RDFa and N3 parsers. (Deprecated, please see RDF.rb https://github.org/gkellogg/rdf and my other related gems)
24 stars 5 forks source link

Can't print a Triple pattern, e.g. when debugging #2

Closed ijdickinson closed 14 years ago

ijdickinson commented 14 years ago

A Triple with one or more nulls is a Triple pattern. I found that I couldn't print a pattern, e.g. using puts during debugging, because inspect calls to_n3 which checks for any nil values in s, p or o. The error I get is:

RdfContext::RdfException: Can't serialize pattern triple
'RdfContext::URIRef[<http://example.org/foo>, ns=nil], 
RdfContext::URIRef[<http://example.org/p>, ns=nil], nil'
from /var/lib/gems/1.9.1/gems/rdf_context-0.5.5/lib/rdf_context/triple.rb:41:in `to_n3'
from /var/lib/gems/1.9.1/gems/rdf_context-0.5.5/lib/rdf_context/triple.rb:49:in `inspect'

Ian

gkellogg commented 14 years ago

Thanks for the report, I'll look into it shortly. I have a couple of other changes I'd like to get in too.

gkellogg commented 14 years ago

Pushed in version 0.5.6