Query Use Cases

Andy Seaborne and Alberto Reggiori

Produced: Mon Jun 24 20:21:43 CEST 2002

This document is a list of query use cases.

Use Cases

 

1: Find email message give message id

Description Find an email messages, given some information about the message
where the data records the message headers (RFC2822).
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1024996825-10501.rdf
Notes

Examples

Add new example ]
LanguageQuery
RDQL SELECT ?x
WHERE (?x, <email:message-id>, '123456@example.com')
USING email FOR <http://www.hpl.hp.com/email/email#>

 

2: Find some value in a data structure

Description Find the a data value within a larger structure of RDF. For example: find the given name, where we know the family name.
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1024997137-13181.rdf
Notes This depends on the regularity of the data

Examples

Add new example ]
LanguageQuery
RDQL SELECT ?v
WHERE
  (?x, <vcard:N>, ?y) ,
  (?y, <vcard:Family>, "Smith") ,
  (?y, <vcard:Given>, ?v)
USING 
  vcard FOR <http://www.w3.org/2001/vcard-rdf/3.0#>

 

3: Find some values and the assoicated schema information

Description For a known resource, find the values of properties which have range
information in the schema.
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1024997280-31327.rdf
Notes If no range information from the schema is available, this
query fails to match a property of resource <x>.

Examples

Add new example ]
LanguageQuery
RDQL SELECT ?property, ?value, ?type
WHERE
  (<data:x>, ?property, ?value) ,
  (?property, <rdfs:range>, ?type)
USING 
  vcard FOR <http://www.w3.org/2001/vcard-rdf/3.0#>
  rdfs  FOR <http://www.w3.org/2000/01/rdf-schema#>
  rdf   FOR <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  data  FOR <file://test/>

 

4: Extract information from RDF for report generation

Description Given an RDF database of various information, extract selected parts for generating (say) an HTML document from the content. The result of the query is a collection of variable bindings that are passed to a report formatter. This approach has been used in practice for the generation of Internet protocol registry documents.
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1024997517-12612.rdf
Notes

Examples

Add new example ]
LanguageQuery
Custom
( ?Header
  ( rdf:type hdr:HeaderField &
    hdr:fieldName ?name &
    rdfs:label ?purpose &
    hdr:protocol ?p
    ( hdr:protocolName ?pname &
      hdr:specification ?ps hdr:document ?psdocument ) ) )
N3/RDF
hrep:HdrProtoPattern :-
  ( [ rep:var "header" ]
    [ rep:and
      ( [ rep:uri rdf:type ] [ rep:uri hdr:HeaderField ] ),
      ( [ rep:uri hdr:fieldName ] [ rep:var "name" ] ),
      ( [ rep:uri rdfs:label ] [ rep:var "purpose" ] ),
      ( [ rep:uri hdr:protocol ] [ rep:var "p" ]
        [ rep:and
          ( [ rep:uri hdr:protocolName] [ rep:var "pname" ] ),
          ( [ rep:uri hdr:specification] [ rep:var "ps" ]
            [ rep:uri hdr:document ] [ rep:var "psdocument" ] )
      ] )
   ] ) .

 

5: Find the title and URL of the latest published articles on XMLHack.com Web site

Description Find the title and link (URL) of the latest published articles on XMLHack.com Web site published as RSS1.0
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1024999879-27433.rdf
Notes

Examples

Add new example ]
LanguageQuery
RDQL
SELECT ?title, ?link
FROM <http://xmlhack.com/rss10.php>
WHERE
     (?item, <rdf:type>, <rss:item>),
     (?item, <rss::title>, ?title),
     (?item, <rss::link>, ?link)
USING
     rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
     rss for <http://purl.org/rss/1.0/>

 

6: Find the URL of the latest published articles on XMLHack.com Web site which title contains the word 'RDQL'

Description Find the URL of the latest published articles on XMLHack.com Web site which title contains the word 'RDQL'
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1025000021-18764.rdf
Notes

Examples

Add new example ]
LanguageQuery
RDQL/RDFStore
SELECT ?link
FROM <http://xmlhack.com/rss10.php>
WHERE
     (?item, <rdf:type>, <rss:item>),
     (?item, <rss::title>, %"RDQL"%),
     (?item, <rss::link>, ?link)
USING
     rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
     rss for <http://purl.org/rss/1.0/>
RDQL/RDFStore
SELECT ?link
FROM <http://xmlhack.com/rss10.php>
WHERE
      (?item, <rdf:type>, <rss:item>),
      (?item, <rss::title>, ?title),
      (?item, <rss::link>, ?link)
AND ?title LIKE '/RDql/i'
USING
     rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
     rss for <http://purl.org/rss/1.0/>

 

7: For the given resource find the title, the subject, the description and their languages together with the language of the resource and its URL

Description For the given RDF DC/DCQ resource description find the dc:title, the dc:subject (encoded using the ETB multilingual thesaurus), the dc:description and their dc:language qualification; in addition retrieve the dc:language of the resource and dc:identifier given the URL pointing to it.
Date 2002-06-25
URL http://rdfstore.sourceforge.net/2002/06/24/rdf-query/incoming/139191723-1025000200-851.rdf
Notes

Examples

Add new example ]
LanguageQuery
RDQL
SELECT
      ?title_value, ?title_language,
      ?subject_value,?subject_language,
      ?description_value, ?description_language,
      ?language,
      ?identifier
FROM
    <http://etbrowse.jrc.it/xml/rdf/example10.xml>
WHERE
      ( ?x, <dc:title>, ?tt),
      ( ?tt, <rdf:value>, ?title_value),
      ( ?tt, <dc:language>, ?ttl),
      ( ?ttl, <dcq:RFC1766>, ?title_language),
      ( ?x, <dc:subject>, ?ss1),
      ( ?ss1, <etbthes:ETBT>, ?ss2),
      ( ?ss2, <rdf:value>, ?subject_value),
      ( ?ss2, <dc:language>, ?ss3),
      ( ?ss3, <dcq:RFC1766>, ?subject_language),
      ( ?x, <dc:description>, ?dd),
      ( ?dd, <rdf:value>, ?description_value),
      ( ?dd, <dc:language>, ?ddl),
      ( ?ddl, <dcq:RFC1766>, ?description_language),
      ( ?x, <dc:identifier>, ?identifier),
      ( ?x, <dc:language>, ?ll1),
      ( ?ll1, <dcq:RFC1766>, ?language)
USING
     rdf for <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
     rdfs for <http://www.w3.org/2000/01/rdf-schema#>,
     dc for <http://purl.org/dc/elements/1.1/>,
     dcq for <http://purl.org/dc/terms/>,
     dct for <http://purl.org/dc/dcmitype/>,
     etb for <http://eun.org/etb/elements/>,
     etbthes for <http://eun.org/etb/thesaurus/elements/>

 

Notes

This document was automatically generated from the RDF for the use cases.

To submit new use cases or change existing ones, please email Alberto Reggiori or Andy Seaborne.