RDFLib/rdflib — Issue #35: add Graph.fromN3
Author: gjhiggins
Created: 2012-02-20 08:31:00+00:00
State: open

drewpca, 2008-12-26T22:31:59.000Z

It would help the creation of our test cases, rdflib's test cases, bug
reports, and tutorials if there was a one-liner to make a graph initialized
from some N3. I propose this API:

from rdflib.Graph import Graph
graph = Graph.fromN3("""
@prefix ...

""")

Comment 1 by lindstr...@gmail.com
In trunk, I think the 'data' parameter to 'Graph.parse' is good enough. Use like::

from rdflib.graph import Graph
graph = Graph( format="n3", data="""@prefix ... """)

Can this issue thus be closed? (Sure, the relevant tests should be adapted to use this as well..)

Comment 2 by drewpca
Yes, that's equivalent to what I was looking for. Thanks for the update.

Should we have a label for 'put this in the release notes'?