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")
_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. 🙂

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com 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

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

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: