簡體   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