#-------------------------------------------------------
PREFIX  bibo: <http://purl.org/ontology/bibo/>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>

SELECT DISTINCT  ?pred ?author_url ?author_name
WHERE
  { <http://data.semanticweb.org/conference/eswc/2014/paper/poster/20> bibo:authorList ?authorList .
    ?authorList ?pred ?author_url .
    ?author_url foaf:name ?author_name
  }
ORDER BY ?pred
#-------------------------------------------------------
SELECT  ?entity ?label1
WHERE
  { OPTIONAL
      { ?entity <http://www.w3.org/2000/01/rdf-schema#label> ?label1
        FILTER regex(str(?label1), "amazon", "i")
      }
    FILTER bound(?label1)
    FILTER isIRI(?entity)
  }
LIMIT   40
#-------------------------------------------------------
ASK
WHERE
  { ?sub ?pred ?obj }
#-------------------------------------------------------
SELECT  (count(?p) AS ?no) ?p
WHERE
  { ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
    ?s ?p ?o
    FILTER isLiteral(?o)
  }
GROUP BY ?p
#-------------------------------------------------------
PREFIX  ical: <http://www.w3.org/2002/12/cal/ical#>
PREFIX  icaltzid: <http://www.w3.org/2002/12/cal/icaltzid#>
PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  swc:  <http://data.semanticweb.org/ns/swc/ontology#>

SELECT DISTINCT  ?name ?homepage ?type ?page ?sameAs ?seeAlso ?graph ?logo
WHERE
  { <http://data.semanticweb.org/conference/eswc/2008> rdfs:label ?name
      { <http://data.semanticweb.org/conference/eswc/2008> icaltzid:url ?homepage }
    UNION
      { <http://data.semanticweb.org/conference/eswc/2008> ical:url ?homepage }
    UNION
      { <http://data.semanticweb.org/conference/eswc/2008> foaf:homepage ?homepage }
    <http://data.semanticweb.org/conference/eswc/2008> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type
    OPTIONAL
      { <http://data.semanticweb.org/conference/eswc/2008> swc:completeGraph ?graph }
    OPTIONAL
      {   { <http://data.semanticweb.org/conference/eswc/2008> swc:hasLogo ?logo }
        UNION
          { <http://data.semanticweb.org/conference/eswc/2008> foaf:logo ?logo }
      }
    OPTIONAL
      { <http://data.semanticweb.org/conference/eswc/2008> foaf:page ?page }
    OPTIONAL
      { <http://data.semanticweb.org/conference/eswc/2008> owl:sameAs ?sameAs }
    OPTIONAL
      { <http://data.semanticweb.org/conference/eswc/2008> rdfs:seeAlso ?seeAlso }
  }
#-------------------------------------------------------
PREFIX  skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>

SELECT DISTINCT  ?person_uri ?person_name
WHERE
  { ?person_uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> foaf:Person
      { ?person_uri skos:prefLabel ?person_name }
    UNION
      { ?person_uri foaf:name ?person_name
        OPTIONAL
          { ?person_uri skos:prefLabel ?prefLabel }
        FILTER ( ! bound(?prefLabel) )
      }
    FILTER regex(str(?person_uri), "^http://data.semanticweb.org")
  }
ORDER BY ?person_uri
#-------------------------------------------------------
PREFIX  skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX  bibo: <http://purl.org/ontology/bibo/>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  swrcext: <http://www.cs.vu.nl/~mcaklein/onto/swrc_ext/2005/05#>

SELECT DISTINCT  ?pred ?author_url ?author_name ?author_pref_label
WHERE
  { GRAPH ?graph
      {   { <http://data.semanticweb.org/conference/lrec/2008/papers/90> bibo:authorList ?authorList }
        UNION
          { <http://data.semanticweb.org/conference/lrec/2008/papers/90> swrcext:authorList ?authorList }
        ?authorList ?pred ?author_url
          { ?author_url foaf:name ?author_name }
        UNION
          { ?author_url rdfs:label ?author_name }
        OPTIONAL
          { ?author_url skos:prefLabel ?author_pref_label }
      }
  }
ORDER BY ?pred
#-------------------------------------------------------
SELECT  ?p (count(?p) AS ?pCount)
WHERE
  { ?s ?p ?o }
GROUP BY ?p
ORDER BY DESC(?pCount)
LIMIT   20
#-------------------------------------------------------
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>

SELECT DISTINCT  ?orga
WHERE
  { ?orga <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> foaf:Organization }
#-------------------------------------------------------
DESCRIBE <http://data.semanticweb.org/person/nadjet-bouayad-agha>
#-------------------------------------------------------
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  swc:  <http://data.semanticweb.org/ns/swc/ontology#>

SELECT DISTINCT  ?conf_uri ?conf_name ?conf_acronym
WHERE
  { ?conf_uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> swc:ConferenceEvent .
    ?conf_uri rdfs:label ?conf_name .
    ?conf_uri swc:hasAcronym ?conf_acronym
  }
ORDER BY ?conf_acronym
#-------------------------------------------------------
SELECT  ?resource_uri (count(distinct ?property) AS ?datatype_properties)
WHERE
  { ?resource_uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?concept .
    ?resource_uri ?property ?value
  }
GROUP BY ?resource_uri
OFFSET  22000
LIMIT   1000
#-------------------------------------------------------
SELECT DISTINCT  ?instance ?p ?o
WHERE
  { ?instance <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
    ?instance ?p ?o
  }
ORDER BY ?instance ?p ?o
OFFSET  7000
LIMIT   1000
#-------------------------------------------------------
CONSTRUCT 
  { ?v159 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.vis.uni-stuttgart.de/haagfn/temp/r> .
    ?v159 <http://www.vis.uni-stuttgart.de/haagfn/temp/label> ?v160 .}
WHERE
  { { SELECT DISTINCT  ?v159
      WHERE
        { FILTER regex(str(?v159), "lohmann", "i") }
      OFFSET  0
      LIMIT   20
    }
    OPTIONAL
      { ?v159 (<http://www.w3.org/2000/01/rdf-schema#label>|<http://www.w3.org/2004/02/skos/core#prefLabel>)|<http://purl.org/dc/elements/1.1/title> ?v160 }
  }
#-------------------------------------------------------
PREFIX  geo:  <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX  swrc: <http://swrc.ontoware.org/ontology#>
PREFIX  ical: <http://www.w3.org/2002/12/cal/ical#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
PREFIX  swrc-ext: <http://www.cs.vu.nl/~mcaklein/onto/swrc_ext/2005/05#>
PREFIX  dcterms: <http://purl.org/dc/terms/>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  swc:  <http://data.semanticweb.org/ns/swc/ontology#>
PREFIX  dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT  ?s ?p ?o
WHERE
  { ?s ?p ?o }
#-------------------------------------------------------
PREFIX  geo:  <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX  swrc: <http://swrc.ontoware.org/ontology#>
PREFIX  ical: <http://www.w3.org/2002/12/cal/ical#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
PREFIX  swrc-ext: <http://www.cs.vu.nl/~mcaklein/onto/swrc_ext/2005/05#>
PREFIX  dcterms: <http://purl.org/dc/terms/>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  swc:  <http://data.semanticweb.org/ns/swc/ontology#>
PREFIX  dc:   <http://purl.org/dc/elements/1.1/>

CONSTRUCT 
  { ?p ?property ?hasValue .}
WHERE
  { { ?p ?property ?hasValue }
    { SELECT  ?p (count(?paper) AS ?count2)
      WHERE
        { ?p rdf:type foaf:Person .
          ?p foaf:made ?paper
        }
      GROUP BY ?p
    }
    { SELECT  ?p (count(?paper) AS ?count)
      WHERE
        { ?p rdf:type foaf:Person .
          ?p foaf:made ?paper
          { SELECT  ?paper
            WHERE
              { ?p rdf:type foaf:Person .
                ?p foaf:made ?paper
              }
            GROUP BY ?paper
            HAVING ( count(?p) = 1 )
          }
        }
      GROUP BY ?p
    }
    FILTER ( ?count = ?count2 )
  }
ORDER BY ( ! bound(?hasValue) ) ?p ?property ?hasValue
#-------------------------------------------------------
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT  *
WHERE
  { ?s rdf:type ?o }
ORDER BY ASC(?s)
LIMIT   100
#-------------------------------------------------------
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  swrc: <http://swrc.ontoware.org/ontology#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  swc:  <http://data.semanticweb.org/ns/swc/ontology#>
PREFIX  dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT  ?abstract ?keyword ?author_name
WHERE
  {   { <http://data.semanticweb.org/conference/eswc/2014/paper/demo/38> swrc:author ?author }
    UNION
      { <http://data.semanticweb.org/conference/eswc/2014/paper/demo/38> foaf:maker ?author }
    ?author foaf:name ?author_name
    OPTIONAL
      { <http://data.semanticweb.org/conference/eswc/2014/paper/demo/38> swrc:abstract ?abstract }
    OPTIONAL
      {   { <http://data.semanticweb.org/conference/eswc/2014/paper/demo/38> swrc:keywords ?keyword }
        UNION
          { <http://data.semanticweb.org/conference/eswc/2014/paper/demo/38> dc:subject ?keyword }
        UNION
          { <http://data.semanticweb.org/conference/eswc/2014/paper/demo/38> swc:hasTopic ?topic .
            ?topic rdfs:label ?keyword
          }
      }
  }
#-------------------------------------------------------
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT  ?a ?c
WHERE
  { ?a rdf:type ?c
    OPTIONAL
      { ?c rdf:type ?e }
    FILTER ( ! bound(?e) )
  }
LIMIT   100
#-------------------------------------------------------
PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX  dcterms: <http://purl.org/dc/terms/>
PREFIX  skos: <http://www.w3.org/2004/02/skos/core/>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT  ?prop
WHERE
  { ?obj rdf:type <http://sw.deri.org/2005/08/conf/cfp.owl#CallForPapers> .
    ?obj ?prop ?targetObj
    FILTER isLiteral(?targetObj)
  }
LIMIT   150
#-------------------------------------------------------
PREFIX  dct:  <http://purl.org/dc/terms/>
PREFIX  skos: <http://www.w3.org/2004/02/skos/core#>

SELECT  *
WHERE
  { GRAPH ?g
      { ?s ?p ?o }
  }
LIMIT   5000
#-------------------------------------------------------
SELECT DISTINCT  ?v151
WHERE
  { ?v151 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>
      { ?v151 <http://www.w3.org/2000/01/rdf-schema#label> ?v152
        FILTER contains(ucase(?v152), ucase("lohmann"))
      }
    UNION
      { ?v151 <http://www.w3.org/2000/01/rdf-schema#label> ?v153
        FILTER contains(ucase(?v153), ucase("haag"))
      }
  }
#-------------------------------------------------------
PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX  dcterms: <http://purl.org/dc/terms/>
PREFIX  skos: <http://www.w3.org/2004/02/skos/core/>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT  ?concept
WHERE
  { ?obj rdf:type ?concept }
LIMIT   150
#-------------------------------------------------------
SELECT  ?resource_uri (count(distinct ?property) AS ?datatype_properties)
WHERE
  { ?resource_uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?concept .
    ?resource_uri ?property ?value
  }
GROUP BY ?resource_uri
OFFSET  12000
LIMIT   1000
#-------------------------------------------------------
PREFIX  ical: <http://www.w3.org/2002/12/cal/ical#>
PREFIX  dct:  <http://purl.org/dc/terms/>
PREFIX  skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  dc:   <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT  ?s ?type ?name ?prefLabel
WHERE
  { ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type
    OPTIONAL
      {   { ?s foaf:name ?name }
        UNION
          { ?s dc:title ?name }
        UNION
          { ?s dct:title ?name }
        UNION
          { ?s ical:summary ?name }
        UNION
          { ?s rdfs:label ?name }
      }
    OPTIONAL
      { ?s skos:prefLabel ?prefLabel }
    FILTER regex(str(?s), "^http://data.semanticweb.org")
    FILTER ( ! regex(str(?s), "^http://data.semanticweb.org/ns") )
  }
