1. what you need to prepare for your tools?
- cx_Oracle (if you use Oracle semantic technology, this is for Oracle connection)
- sparql wrapper (for SPARQL query on the Graph database)
2. some modules you might use
import re,os,csv, shlex #(shlex for space cuting)
from rdflib import Graph, ConjunctiveGraph
from rdflib import URIRef, Literal, Namespace, BNode, ConjunctiveGraph
from rdflib import RDF, RDFS
rdflib.plugin.register('sparql', rdflib.query.Processor,'rdfextras.sparql.processor', 'Processor')
rdflib.plugin.register('sparql', rdflib.query.Result, 'rdfextras.sparql.query', 'SPARQLQueryResult')import logging _logger = logging.getLogger("rdflib") _logger.setLevel(logging.DEBUG) _hdlr = logging.StreamHandler() _hdlr.setFormatter(logging.Formatter('%(name)s %(levelname)s: %(message)s')) _logger.addHandler(_hdlr) from rdflib.plugins.memory import IOMemory import pprint #(I use it for checking out the status of the Graph)
3. some tricky questions
- how to build the paths between the nodes in your Graph?
- how to find the paths between your own nodes and others’? e.g. DBpedia
- how to automatically realize the above steps?
- how to name a cool URI for the resource?
The power of the Semantic Web lies in its metadata which link with each other, so its ontology should be reused by others, e.g., vocabulory in OWL, RDFS, FOAF, GeoName, etc., rather than define it by yourself.
so SPARQL query plays key role in this step, cross-inference, link to resource outside. If you have at least 1000 triples, and use any URIs from any dataset that is already in the Linked Open Data diagram, maybe a circle which stands for your data will appear in the LOD diagram next year. 🙂