简体   繁体   中英

sparql query - triple

I am a biology trying to understand the meaning of a triple from this SPARQL query. If "a" is a triple, what are the resources for subject, object and predicate in this sample query?

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")
}

I appreciate your help?

Thanks, AD

?experiment
a atlasterms:Experiment ;

is the same as

?experiment a atlasterms:Experiment ;

is the same as

?experiment rdf:type atlasterms:Experiment ;

so the form in the query is just a whitespace rearrangement and using the built-in abbreviation "a" for property rdf:type.

See http://www.sparql.org/query-validator.html for an online formatter of SPARQL queries.

A simpler query is:

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

because

SELECT DISTINCT  ?experiment ?description

means that the ?propertyType/?propertyValue part is not affecting the outcome.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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