我试图用protege 5运行sparql。这是我用protege5创建的本体论:
async addItem(text) {
await this.itemService.addItem({text});
// reload items after adding
this.items = this.itemService.loadItems();
}
我试图在<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#"
xml:base="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#family -->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#family">
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#name -->
<owl:Class rdf:about="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#name"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#amin -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#amin">
<family rdf:datatype="http://www.w3.org/2001/XMLSchema#string">mazrouei</family>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#sara -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#sara">
<family>rezaei</family>
</owl:NamedIndividual>
</rdf:RDF>
<!-- Generated by the OWL API (version 4.2.5.20160517-0735) https://github.com/owlcs/owlapi -->
窗口中运行此查询:
snap sparql query
但未返回任何结果。PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX :<http://www.semanticweb.org/lion/ontologies/2017/5/untitled-ontology-73#>
SELECT ?x WHERE{?x :family ?y}
是一个数据属性,用于定义个人的系列。我怎么能解决这个问题?
答案 0 :(得分:1)
Snap SPARQL插件专为查询涉及推断知识而设计。然而,它的UI有一种奇怪之处。如果选择了推理器,但未启动,则查询将返回空结果。
为了得到预期的结果,应该: