저는 JENA를 사용 중이며 학습 목적으로 간단한 쿼리를 작성하려고합니다. 그 중 하나는 : 4 트리플 나머지없이쿼리 SPARQL에 결과가 없습니다.
PREFIX uni:<http://www.university.fake/university#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT ?person
WHERE {
?person rdf:type/rdfs:subClassOf <uni:Person>.
?person uni:has_name ?name.
?person uni:member_of ?dep.
?dep uni:dep_city "Patras".
}
는 3 일의 ?dep
가 인용 한 값으로 대체되는 경우 결과를 않습니다. 그러나 4 번째 트리플을 추가 할 경우 결과가 없습니다. 트리플 자체는 자체 쿼리에서 결과를 생성하므로 거기에 문제가 있다고 생각하지 않습니다.
RDF의 데이터의 일부 :
<rdf:Property rdf:about="uni:member_of">
<rdfs:domain rdf:resource="uni:Person"/>
<rdfs:range rdf:resource="uni:Department"/>
</rdf:Property>
<rdf:Property rdf:about="uni:dep_city">
<rdfs:domain rdf:resource="uni:Department"/>
<rdfs:range rdf:resource="uni:Literal"/>
</rdf:Property>
<rdf:Description rdf:about="uni:dep1">
<uni:dep_name>CEID</uni:dep_name>
<uni:dep_city>Patras</uni:dep_city>
</rdf:Description>
<rdf:Description rdf:about="uni:prof2">
<uni:has_name>Bob Ross</uni:has_name>
<uni:has_phone>6981234566</uni:has_phone>
<uni:has_age>52</uni:has_age>
<uni:member_of>CEID</uni:member_of>
<uni:teaches>Painting</uni:teaches>
<rdf:type rdf:resource="uni:Professor"/>
</rdf:Description>
그래서 '? dep uni : dep_city "Patras"'works? 거꾸로 작업 해보십시오.'? person uni : member_of? dep. ? dep uni : dep_city "Patras"'등 – user205512
또한 가능한 경우 데이터를 제공하십시오. 데이터없이 진단하기가 어렵습니다. – user205512
예, 작동합니다. 당신이 제안하는 두 번째 쿼리는 작동하지 않으며 문제가있는 곳일 것입니다.RDF의 데이터의 예는 다음과 ' \t 밥 로스 UNI : has_name> \t 6981234566 유니 : has_phone> \t 52 UNI : has_age> \t CEID UNI : MEMBER_OF> \t 도장 UNI : 교시> \t RDF : 설명> \t CEID UNI : dep_name> \t Patras uni : dep_city> rdf : 설명>' –