Monday 15 July 2013

python 2.7 - OWL File Query Execution Error in RDFLIB -


I am trying to create a SPARQL query on an OWL file (see) but this is the first time that I have an OWL file , So I used RDFLIB in Python to create SPRQL queries. I get an error when I run the code (shown below the code) which I do not understand. What could be the reason?

code
  import rdflib graph = rdflib.Graph () prefix = "" "PREFIX DC:  PREFIX FoF: & lt; http: //xmlns.com/foaf/0.1/> PREFIX olia-ar: & lt; http: //purl.org/olia/arabic_khoja.owl#> prefix digitum : & Lt; http: //purl.org/dc/terms/>PREFIX rdfs: & lt; http: //www.w3.org/2000/01/rdf-schema#> PREFIX OWL: & lt; Http://www.w3.org/2002/07/owl#> PREFIX xsd: http: //www.w3.org/2001/XMLSchema#> PREFIX lexvo: & lt; http: // Lexvo org / id / iso639-3 /> PREFIX rdf: & lt; http: //www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX p1: & lt; http: // Dependent Stanford.edu/plugins/owl/protege#>PREFIX Base: & lt; http: //www.owl-ontologies.com/unnamed.owl#> PREFIX xmlns: & lt; http: // www .owl-ontologies com / unnamed.owl # & gt; "" "queryString = prefix +" \ n "+" "SELECT? Animal class WHERE {? Animals: Has_Usage "Ride"; Rdf: type? AnimalClass.} "" Graph.An Animal.owl ') result = graph.query (queryString) for the resulting line: print line   

error

No comments:

Post a Comment