/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import rdflib from rdflib.Graph import Graph g = Graph() myfile = "/Users/mac/Code/Java/Jena-2.3/doc/inference/data/demoData.rdf" g.parse(myfile, format="xml") print "the lenght of the graph is: ", len(g) for st in g: print st