Результаты SPARQL-запросов не работают с локальным OWL-файлом - PullRequest
0 голосов
/ 06 сентября 2018

Недавно я создал онтологию, используя protege и затем Apache Jena Fuseki 3.8.0 для запроса результатов.

Таким образом, файл .OWL размещается локально с использованием MAMP. Файл OWL размещен без проблем.

Но когда я делаю простой запрос,

PREFIX uni:<http://localhost:8888/university.owl#>
SELECT * {?Student uni:studies uni:M101}

Это не показывает никаких результатов. Что может вызвать эту проблему? Это потому, что я разместил файл .OWL локально? Или есть другие вопросы?

Файл OWL, указанный ниже, если необходимо.

<rdf:RDF xmlns="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xml:base="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl">
<owl:Ontology rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl"/>
 <!--

    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Object Properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////

-->
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#studies 
-->
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#studies">
<rdfs:domain rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student"/>
<rdfs:range rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Module"/>
</owl:ObjectProperty>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#teaches 
-->
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#teaches"/>
 <!--  http://www.w3.org/2002/07/owl#topObjectProperty  -->
<rdf:Description rdf:about="http://www.w3.org/2002/07/owl#topObjectProperty">
<rdfs:domain rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer"/>
<rdfs:range rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Module"/>
</rdf:Description>
 <!--

    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Data properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////

-->
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#first_name 
-->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#first_name">
<rdfs:domain rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Person"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#last_name 
-->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#last_name">
<rdfs:domain rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Person"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#staffID 
-->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#staffID">
<rdfs:domain rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</owl:DatatypeProperty>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#studentID 
-->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#studentID">
<rdfs:domain rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</owl:DatatypeProperty>
 <!--

    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////

-->
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer 
-->
<owl:Class rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Person"/>
</owl:Class>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#MobileModule 
-->
<owl:Class rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#MobileModule">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Module"/>
</owl:Class>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Module 
-->
<owl:Class rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Module"/>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Person 
-->
<owl:Class rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Person"/>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student 
-->
<owl:Class rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Person"/>
</owl:Class>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#WebModule 
-->
<owl:Class rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#WebModule">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Module"/>
</owl:Class>
 <!--

    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Individuals
    //
    ///////////////////////////////////////////////////////////////////////////////////////

-->
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer1 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer1">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer"/>
<teaches rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M101"/>
<teaches rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M102"/>
<first_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Chris</first_name>
<last_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Brown</last_name>
<staffID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">43532</staffID>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer2 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer2">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer"/>
<teaches rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W101"/>
<teaches rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W103"/>
<first_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Larisa</first_name>
<last_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Sherman</last_name>
<staffID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">24214</staffID>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M101 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M101">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#MobileModule"/>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M102 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M102">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#MobileModule"/>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student1 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student1">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student"/>
<studies rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M101"/>
<studies rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W101"/>
<first_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Steve</first_name>
<last_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Perera</last_name>
<studentID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2015062</studentID>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student2 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student2">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student"/>
<studies rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M102"/>
<studies rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W103"/>
<first_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Justin</first_name>
<last_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Nience</last_name>
<studentID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2015063</studentID>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student3 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student3">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student"/>
<studies rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#M101"/>
<first_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">John</first_name>
<last_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Fernando</last_name>
<studentID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2015076</studentID>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W101 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W101">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#WebModule"/>
</owl:NamedIndividual>
 <!--
 http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W103 
-->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#W103">
<rdf:type rdf:resource="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#WebModule"/>
</owl:NamedIndividual>
 <!--

    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // General axioms
    //
    ///////////////////////////////////////////////////////////////////////////////////////

-->
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AllDisjointClasses"/>
<owl:members rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Lecturer"/>
<rdf:Description rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#MobileModule"/>
<rdf:Description rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#Student"/>
<rdf:Description rdf:about="http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#WebModule"/>
</owl:members>
</rdf:Description>
</rdf:RDF>
<!--
 Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi 
-->

1 Ответ

0 голосов
/ 06 сентября 2018

В соответствии с вашими предпочтениями Protégé ( Файл> Предпочтения ), новый IRI объекта начинается с URI активной онтологии, затем следует # и заканчивается именем пользователя.

Таким образом, объявите префикс uni следующим образом:

PREFIX uni: <http://www.semanticweb.org/lakindugunasekara/ontologies/2018/8/university.owl#>

...