Changes between Version 7 and Version 8 of CMD2RDF/Queries


Ignore:
Timestamp:
05/26/14 23:10:13 (10 years ago)
Author:
xnrn@gmx.net
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CMD2RDF/Queries

    v7 v8  
    143143
    144144
    145 === Search by DatCat
     145=== Search by !DatCat
    146146
    147 Search in description fields for string `syntax` or `parse`:
     147Search in description fields for string `syntax` or `parse`, get the field value and the resource-identifier:
    148148{{{
    149149#!sql
    150150PREFIX dcr: <http://www.isocat.org/ns/dcr.rdf#>
    151151
    152 SELECT ?v as ?resourcetitle
    153 WHERE {?cmdelem dcr:datcat "http://www.isocat.org/datcat/DC-2520".
     152SELECT ?g as ?resGraph ?v as ?resourcetitle
     153WHERE { GRAPH ?g {?cmdelem dcr:datcat "http://www.isocat.org/datcat/DC-2520".}
    154154       ?instelem a ?cmdelem.
    155155       ?instelem ?p ?v.
     156
    156157FILTER isLiteral(?v).
    157158FILTER REGEX(?v, "(syntax|parse)", "i")
    158159}
     160}
    159161}}}
    160162
    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`)
    162164
     165
     166=== Traverse `cmdm:contains`
     167
     168List all elements starting from given root component, show the element type and the value:
     169
     170{{{
     171#!sql
     172PREFIX cmdm: <http://www.clarin.eu/cmd/general.rdf#>
     173
     174select ?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.
     179FILTER( isLiteral(?value))
     180}
     181}}}