From: <ku...@us...> - 2009-02-04 17:20:16
|
Revision: 324 http://mypyspace.svn.sourceforge.net/mypyspace/?rev=324&view=rev Author: kurtjx Date: 2009-02-04 17:20:12 +0000 (Wed, 04 Feb 2009) Log Message: ----------- old2sparul working properly :-) Modified Paths: -------------- graphRDF/branches/old2sparul/old2sparul.py Modified: graphRDF/branches/old2sparul/old2sparul.py =================================================================== --- graphRDF/branches/old2sparul/old2sparul.py 2009-02-04 15:18:08 UTC (rev 323) +++ graphRDF/branches/old2sparul/old2sparul.py 2009-02-04 17:20:12 UTC (rev 324) @@ -26,11 +26,11 @@ failedList = [] badQueryList = [] -defaultGraph = "http://dbtune.org/myspace-fj-2008p" +defaultGraph = "http://dbtune.org/myspace-fj-set-2008" sparqlEndPoint = "http://dbtune.org/cmn/sparql" myspaceBase = "http://dbtune.org/myspace/uid" myspaceOnt = "http://purl.org/ontology/myspace" -prefixes = """PREFIX owl: <http://www.w3.org/2002/07/owl#> \nPREFIX foaf: <http://xmlns.com/foaf/0.1/> \nPREFIX dc: <http://purl.org/dc/elements/1.1/> \nPREFIX mo: <http://purl.org/ontology/mo/>\nPREFIX myspace: <http://purl.org/ontology/myspace#>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>""" +prefixes = """PREFIX owl: <http://www.w3.org/2002/07/owl#> \nPREFIX foaf: <http://xmlns.com/foaf/0.1/> \nPREFIX dc: <http://purl.org/dc/elements/1.1/> \nPREFIX mo: <http://purl.org/ontology/mo/>\nPREFIX myspace: <http://purl.org/ontology/myspace#>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>""" insert = """ \ninsert into graph <"""+defaultGraph+"""> {""" @@ -52,6 +52,8 @@ suid = person.URI.split(base)[1] subject = "<"+myspaceBase+"/"+suid+">" name = person.name.pop() + sparqlU = sparqlU + '\n'+subject+' rdf:type mo:MusicArtist .' + sparqlU = sparqlU + '\n'+subject+' myspace:myspaceID "'+filename.rstrip('.rdf')+'"^^xsd:int .' sparqlU = sparqlU + """\n"""+subject+' foaf:name "' + urllib2.quote(name)+'"@en . ' # get all the top friends @@ -61,6 +63,7 @@ ouid = p.URI.split(base)[1] obj = "<"+myspaceBase+"/"+ouid+">" sparqlU=sparqlU+ "\n"+subject+" foaf:knows "+ obj+ ' . ' "\n"+subject+" myspace:topFriend "+obj+ ' . ' + sparqlU = sparqlU + '\n'+obj+' rdf:type mo:MusicArtist .' except: break This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |