0

当我在 graphdb 的本地实例中运行它时,我有一个可以工作的脚本。但是,当我尝试在https://cloud.ontotext.com/的在线 graphdb 上使用它时,我得到了一个org.eclipse.rdf4j.query.QueryEvaluationException但没有表明脚本的哪一部分导致它。

在本地工作的脚本的唯一变化是

SERVICE <https://rdf.ontotext.com/4136450524/pedtermsDB/repositories/pedagogyrepo>{

这是

SERVICE <http://localhost:7200/rdf-bridge/1967855032375>{

任何帮助表示赞赏。

剧本:

PREFIX spif: <http://spinrdf.org/spif#>
PREFIX pdb:<http://example.org/pedtermsDB/>
# CLEAR GRAPH <http://example.org/pedtermsDB/>
# INSERT query that maps the raw RDF data from OntoRefine to user-specified
# RDF data (different IRIs, types, property names and dates as date-typed literals)
# and inserts the data into the current GraphDB repository.
INSERT { graph <http://example.org/pedtermsDB/> {  
 ?subtermIRI a pdb:SubTerm ;
    pdb:label ?subterm;
    pdb:replyList ?sb_id;
    pdb:hasParent ?termIRI.
 ?termIRI a pdb:Term ;
    pdb:label ?term;
    pdb:replyList ?sb_id;
    pdb:topic ?topicIRI.
 ?topicIRI a pdb:Topic;      
    pdb:label ?topic;
    pdb:mapping ?sb_topic;
    pdb:replyList ?sb_id;
    pdb:subject ?subjectIRI.
# ?sb_topicIRI a pdb:StudyBotTopic;  
#    pdb:mapping ?term;
#    pdb:label ?sb_topic.
 ?subjectIRI a pdb:Subject ;
    pdb:label ?subject;
    pdb:field ?fieldIRI. 
 ?fieldIRI a pdb:Field;
    pdb:label ?field;
    pdb:faculty ?facultyIRI.       
?facultyIRI a pdb:Faculty;
    pdb:label ?faculty;
}
} where {
# Uses SERVICE to fetch the raw RDF data from OntoRefine
SERVICE <https://rdf.ontotext.com/4136450524/pedtermsDB/repositories/pedagogyrepo>{
    ?termRow a pdb:Row; 
    pdb:rowNumber ?termRowNumber.
    OPTIONAL {?termRow pdb:term ?term}
    OPTIONAL {?termRow pdb:sb_id ?sb_id}
    OPTIONAL {?termRow pdb:sb_topic ?sb_topic}
    OPTIONAL {?termRow pdb:subterm ?subterm}
     OPTIONAL {?termRow pdb:topic ?topic}  
    ?termRow pdb:subject ?subject. 
    ?termRow pdb:field ?field.
    ?termRow pdb:faculty ?faculty.

     BIND(iri(concat("http://example.org/pedtermsDB/terms/", ?term)) as ?termIRI)
     BIND(iri(concat("http://example.org/pedtermsDB/subterms/", ?subterm)) as ?subtermIRI)
   # BIND(iri(concat("http://example.org/pedtermsDB/studybotTopics/", ?sb_topic)) as ?sb_topicIRI)
   # BIND(IF(?topic=?term,iri(concat("http://example.org/pedtermsDB/topics/", ?topic)),"") as ?topicIRI)
     BIND(iri(concat("http://example.org/pedtermsDB/topics/", ?topic)) as ?topicIRI)
     BIND(iri(concat("http://example.org/pedtermsDB/subjects/", ?subject)) as ?subjectIRI)
     BIND(iri(concat("http://example.org/pedtermsDB/fields/", ?field)) as ?fieldIRI)
     BIND(iri(concat("http://example.org/pedtermsDB/faculties/", ?faculty)) as ?facultyIRI)    
}
}
4

1 回答 1

1

您的查询中混合了两种不同类型的 SPARQL 端点:

GraphDB 端点 - 为索引 RDF 三元组提供服务的存储库端点:

OntoRefine 端点 - 为 OpenRefine 的内部表格模型提供服务的虚拟端点

您必须通过 Workbench 界面在云上找到正确的 OntoRefine 端点。

于 2018-03-12T15:40:28.300 回答