2017-09-24 3 views
0

Ich versuche, SPARQL Abfragen auf Protege zu lernen, und ich habe einige Personen abzufragen auf der Film-Ontologie gefunden bei hinzugefügt: Movie OntologySPARQL: Ausschließen Datentyp uri von Abfrageergebnis

Ich habe folgende einfache sparql query:

Query 1: Get all movies and actors having rating more than 7.0 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX owl: <http://www.w3.org/2002/07/owl#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 

PREFIX dbo: <http://dbpedia.org/ontology/> 
PREFIX mov: <http://www.movieontology.org/2009/10/01/movieontology.owl#> 

SELECT ?subject ?actors ?rating 
    WHERE { 
     ?subject a mov:Movie; 
      mov:hasActor ?actors; 
      mov:imdbrating ?rating. 
     Filter(?rating > "7.0"^^xsd:double) 
    } 

Und ich bin immer das Ergebnis wie erwartet:

Result

Das Problem ist, dass ich das ^^ xsd: double uri in der Rating-Spalte nicht brauche !! Wie werde ich die uri "^^ http://www.w3.org/2001/XMLSchema#double" loswerden. Vielen Dank im Voraus!

Antwort

2

Verwenden str den lexikalischen Teil zu bekommen

SELECT ?subject ?actors (str(?rating) AS ?r)