Changes between Version 7 and Version 8 of CMD2RDF/Queries
- Timestamp:
- 05/26/14 23:10:13 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CMD2RDF/Queries
v7 v8 143 143 144 144 145 === Search by DatCat145 === Search by !DatCat 146 146 147 Search in description fields for string `syntax` or `parse` :147 Search in description fields for string `syntax` or `parse`, get the field value and the resource-identifier: 148 148 {{{ 149 149 #!sql 150 150 PREFIX dcr: <http://www.isocat.org/ns/dcr.rdf#> 151 151 152 SELECT ? v as ?resourcetitle153 WHERE { ?cmdelem dcr:datcat "http://www.isocat.org/datcat/DC-2520".152 SELECT ?g as ?resGraph ?v as ?resourcetitle 153 WHERE { GRAPH ?g {?cmdelem dcr:datcat "http://www.isocat.org/datcat/DC-2520".} 154 154 ?instelem a ?cmdelem. 155 155 ?instelem ?p ?v. 156 156 157 FILTER isLiteral(?v). 157 158 FILTER REGEX(?v, "(syntax|parse)", "i") 158 159 } 160 } 159 161 }}} 160 162 161 [[http://clarin.aac.ac.at/ sparql?default-graph-uri=&query=PREFIX+dcr%3A+%3Chttp%3A%2F%2Fwww.isocat.org%2Fns%2Fdcr.rdf%23%3E%0D%0A%0D%0ASELECT+%3Fv+as+%3Fresourcetitle%0D%0AWHERE+{%3Fcmdelem+dcr%3Adatcat+%22http%3A%2F%2Fwww.isocat.org%2Fdatcat%2FDC-2520%22.%0D%0A+++++++%3Finstelem+a+%3Fcmdelem.%0D%0A+++++++%3Finstelem+%3Fp+%3Fv.%0D%0AFILTER+isLiteral%28%3Fv%29.%0D%0AFILTER+REGEX%28%3Fv%2C+%22%28syntax%7Cparse%29%22%2C+%22i%22%29%0D%0A}&format=text%2Fhtml&timeout=10000&debug=on| syntax or parse in description ]] (by datcat: [[http://isocat.org/datcat/2520|Description]] `DC-2520`)163 [[http://clarin.aac.ac.at/virtuoso/sparql?default-graph-uri=&query=PREFIX+dcr%3A+%3Chttp%3A%2F%2Fwww.isocat.org%2Fns%2Fdcr.rdf%23%3E%0D%0A%0D%0ASELECT+%3Fg+as+%3FresGraph+%3Fv+as+%3Fresourcetitle%0D%0AWHERE+{+GRAPH+%3Fg+{%3Fcmdelem+dcr%3Adatcat+%22http%3A%2F%2Fwww.isocat.org%2Fdatcat%2FDC-2520%22.}%0D%0A+++++++%3Finstelem+a+%3Fcmdelem.%0D%0A+++++++%3Finstelem+%3Fp+%3Fv.%0D%0A%0D%0AFILTER+isLiteral%28%3Fv%29.%0D%0AFILTER+REGEX%28%3Fv%2C+%22%28syntax%7Cparse%29%22%2C+%22i%22%29%0D%0A}&format=text%2Fhtml&timeout=0&debug=on| syntax or parse in description ]] (by datcat: [[http://isocat.org/datcat/2520|Description]] `DC-2520`) 162 164 165 166 === Traverse `cmdm:contains` 167 168 List all elements starting from given root component, show the element type and the value: 169 170 {{{ 171 #!sql 172 PREFIX cmdm: <http://www.clarin.eu/cmd/general.rdf#> 173 174 select ?elemtype ?value where { <http://www.clarin.eu/cmd/BAS_Repository/oai_BAS_repo_Corpora_aGender_100102.rdf#d56e213> cmdm:contains* ?comp. 175 ?comp cmdm:contains ?elem. 176 ?elem a ?elemtype. 177 ?elem ?haselemvalue ?value. 178 ?elemtype rdfs:subClassOf cmdm:Element. 179 FILTER( isLiteral(?value)) 180 } 181 }}}