sparql和多谓词组中的查询

sparql和多谓词组中的查询,sparql,Sparql,我没有得到正确的句子来提问。 我想用一个样本数据来解释我的问题 假设三元组如下所示 @prefix skos: <http://www.w3.org/2004/02/skos/core#> . @prefix xs: <http://www.w3.org/2001/XMLSchema#> . @prefix p0: <http://www.mlacustom.com#> . @prefix p2: <http://www.mla.com/term/>

我没有得到正确的句子来提问。 我想用一个样本数据来解释我的问题

假设三元组如下所示

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
@prefix p0: <http://www.mlacustom.com#> .
@prefix p2: <http://www.mla.com/term/> .
_:bnode7021016689601753065 p0:lastModifiedDateTime "2018-09-14T12:55:38"^^<xsd:dateTime> ;
                           p0:lastModifiedUser "admin"^^xs:string .
<http://www.mla.com/name/4204078359> p0:hasClassingFacet "http://www.mla.com/facet/RA"^^xs:string ;
                                     p0:type "Normal"^^xs:string ;
                                     p0:classification _:bnode3452184423513029143 ,
                                                       _:bnode6827572371999795686 ;
                                     p0:recordType "Name"^^xs:string ;
                                     p0:recordNumber "4204078359"^^xs:string ;
                                     p0:stdDescriptor "classification111111"^^xs:string ;
                                     p0:establishedBy "admin"^^xs:string ;
                                     skos:prefLabel "classification111111"^^xs:string ;
                                     p0:createdBy "admin"^^xs:string ;
                                     a skos:Concept ;
                                     p0:createdDate "2018-09-14T12:55:38"^^<xsd:dateTime> ;
                                     p0:establishedDate "2018-09-14T12:55:38"^^<xsd:dateTime> ;
                                     p0:hasRAsubFacet "http://www.mla.com/subfacet/classing-subject-authors"^^xs:string ;
                                     p0:lastModifiedDate "2018-09-14T12:55:38"^^<xsd:dateTime> ;
                                     p0:lastModifiedDetails _:bnode7021016689601753065 ;
                                     p0:isProblematic "N,N"^^xs:string ;
                                     p0:lastModifiedBy "admin"^^xs:string ;
                                     p0:status "established"^^xs:string .
_:bnode3452184423513029143 p0:literature p2:1513 ;
                           p0:timePeriod p2:1005 ;
                           p0:language p2:3199 .
_:bnode6827572371999795686 p0:literature p2:11307 ;
                           p0:timePeriod p2:1009 ;
                           p0:language p2:31 .
根据上面的场景,它应该返回
http://www.mla.com/name/4204078359
主题


分类可以有任意数量的空白节点。

以下是解决方案之一。可以找到许多不同的查询。这是明确的

SELECT ?s WHERE {
    ?s p0:classification ?o1 .
    ?s p0:classification ?o2 .

    ?o1 p0:literature p2:1513 ;
        p0:timePeriod p2:1005 .

    ?o2 p0:literature p2:11307 ;
        p0:timePeriod p2:1009 .
}

这里是一个解决方案。可以找到许多不同的查询。这是明确的

SELECT ?s WHERE {
    ?s p0:classification ?o1 .
    ?s p0:classification ?o2 .

    ?o1 p0:literature p2:1513 ;
        p0:timePeriod p2:1005 .

    ?o2 p0:literature p2:11307 ;
        p0:timePeriod p2:1009 .
}

这里有海龟语法的数据。SPARQL非常简单,因为它还支持海龟语法。这意味着,你有了这个结构,只需(重新)使用你感兴趣的部分,并用一个变量替换你感兴趣的每个三元组中的资源。你这里有海龟语法中的数据。SPARQL非常简单,因为它还支持海龟语法。这意味着,您有结构,只需(re)使用感兴趣的部分,并用变量替换您感兴趣的每三个三个元素中的资源