2

私はイエナを初めて使用しますが、現在いくつかの問題に遭遇しています。スーパークラスQuery Processingとその 4 つのサブクラスがあります。

  • クエリ処理
  • — クエリの意図
  • — クエリの再構築
  • — クエリ表現
  • — クエリの提案

私が使用する場合:

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

または、他の3つのサブクラスを述語として使用するinQueryReformulationと、正しい答えが得られます。

ただし、?article Article:inQueryProcessing ?categoryサブクラス 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>

私は ComputerScience でドメイン オントロジーを構築しただけです。すべてのクラスは概念であり (クエリ処理はスーパークラスであり、クエリの意図/再定式化/... はサブクラスです)、すべての論文とそれに対応する著者は個人です。

4

0 に答える 0