playing RDF by use of python

1. what you need to prepare for your tools?

  • Python
  • Rdflib
  • Rdfextras
  • 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)
import cx_Oracle

import rdflib

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")
_hdlr = logging.StreamHandler()
_hdlr.setFormatter(logging.Formatter('%(name)s %(levelname)s: %(message)s'))

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. 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Just another site

Jing's Blog

Just another site

Start from here......







Just another site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision


Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness



Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: