2

我是耶拿的新手,但现在遇到了一些问题。我有一个超类查询处理及其四个子类:

  • 查询处理
  • — 查询意图
  • — 查询重构
  • — 查询表示
  • — 查询建议

当我使用:

PREFIX Article: <http://www.semanticweb.org/aero/ontologies/computer-science#>
SELECT ?paper ?category 
WHERE 
{
  ?paper Article:inQueryIntent ?category .
}

或者用任何其他 3 个子类作为谓词,inQueryReformulation我可以得到正确的答案。

但是,当我使用?article Article:inQueryProcessing ?categorywhich 应该返回与子类 QueryProcessing 相关的所有个人时,我什么也没得到。inQueryIntent(和其他 3 个)并且inQueryProcessing是对象属性。

这是我的代码:

Dataset dataset = TDBFactory.createDataset(directory);
Model model = dataset.getNamedModel(modelName);
OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF, model);
Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
InfModel infModel = ModelFactory.createInfModel(reasoner, ontModel);
Query query = QueryFactory.create(queryString);
QueryExecution queryExe = QueryExecutionFactory.create(query, infModel);

这是本体片段:

对象属性:

<!-- http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#inQueryIntent -->

<owl:ObjectProperty rdf:about="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#inQueryIntent">
    <rdf:type rdf:resource="&owl;FunctionalProperty"/>
    <rdfs:range rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#Query_intent"/>
    <rdfs:domain rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#article"/>
    <rdfs:subPropertyOf rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#inInformationRetrievalQueryProcessing"/>
</owl:ObjectProperty>

班级:

<owl:Class rdf:about="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#Query_intent">
    <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#Information_retrieval_query_processing"/>
</owl:Class>

个人:

<owl:NamedIndividual rdf:about="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#Classifying_Web_Queries_by_Topic_and_User_Intent">
    <rdf:type rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#article"/>
    <hasAuthor rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#Bernard_J._Jansen"/>
    <inQueryIntent rdf:resource="http://www.semanticweb.org/aero/ontologies/2013/1/computer-science#Query_intent"/>
</owl:NamedIndividual>

我只是在计算机科学中建立了一个领域本体,所有的类都是层次结构中的概念(比如查询处理是一个超类,查询意图/重构/......是子类),所有的论文及其通讯作者都是个人

4

0 回答 0