繁体   English   中英

sparql查询 - 三元组

[英]sparql query - triple

我是一个生物学人士,试图从此SPARQL查询中了解三元组的含义。 如果“a”是三元组,则此示例查询中的主题,对象和谓词的资源是什么?

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX efo: <http://www.ebi.ac.uk/efo/>
PREFIX atlas: <http://rdf.ebi.ac.uk/resource/atlas/>
PREFIX atlasterms: <http://rdf.ebi.ac.uk/terms/atlas/>

SELECT DISTINCT ?experiment ?description WHERE
{?experiment
a atlasterms:Experiment ;
dcterms:description ?description ;
 atlasterms:hasAssay
 [atlasterms:hasSample
  [atlasterms:hasSampleCharacteristic
   [ atlasterms:propertyType ?propertyType ;
     atlasterms:propertyValue ?propertyValue]
  ]
 ]
filter regex (?description, "diabetes", "i")
}

我感谢您的帮助?

谢谢,公元

?experiment
a atlasterms:Experiment ;

是相同的

?experiment a atlasterms:Experiment ;

是相同的

?experiment rdf:type atlasterms:Experiment ;

所以查询中的表单只是一个空格重新排列,并使用内置的缩写“a”表示属性rdf:type。

有关SPARQL查询的在线格式化程序,请参见http://www.sparql.org/query-validator.html

一个更简单的查询是:

SELECT DISTINCT  ?experiment ?description
WHERE
  { ?experiment rdf:type atlasterms:Experiment .
    ?experiment dcterms:description ?description
    FILTER regex(?description, "diabetes", "i")
  }

因为

SELECT DISTINCT  ?experiment ?description

表示?propertyType /?propertyValue部分不影响结果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM