ailabitmo / sempubchallenge2014-task1

A solution for the Task 1 of Semantic Publishing Challenge
MIT License
1 stars 1 forks source link

Q1.7: Identify the full names of those chairs of the workshop series titled T that have so far been a chair in every edition of the workshop that was published with CEUR-WS.org #9

Closed KMax closed 10 years ago

KMax commented 10 years ago

http://challenges.2014.eswc-conferences.org/index.php/SemPub/QueriesTask1#Query_Q1.7:_Chairs_over_the_History_of_a_Workshop

KMax commented 10 years ago

Есть один вариант запроса, но кривой, с дублированием:

PREFIX swrc:<http://swrc.ontoware.org/ontology#>
PREFIX foaf:<http://xmlns.com/foaf/0.1/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms:<http://purl.org/dc/terms/>
PREFIX bibo:<http://purl.org/ontology/bibo/>
PREFIX timeline:<http://purl.org/NET/c4dm/timeline.owl#>

SELECT ?search ?editor WHERE {
  {
    SELECT ?search ?workshop ?editor WHERE {
      VALUES ?search {"Linked Data on the Web" "Semantic Publishing"} .
      ?workshop a bibo:Workshop;
                rdfs:label ?label .
      FILTER(strStarts(?label, ?search)) .
      [] a swrc:Proceedings;
                           bibo:presentedAt ?workshop;
                           swrc:editor ?editor .
    }
  }
  {
    SELECT ?search (COUNT(?workshop) AS ?count) WHERE {
      VALUES ?search {"Linked Data on the Web" "Semantic Publishing"} .
      ?workshop a bibo:Workshop;
                rdfs:label ?label .
      FILTER(strStarts(?label, ?search)) .
    }
    GROUP BY ?search
  }
}
GROUP BY ?search ?editor
HAVING (COUNT(?search) = MAX(?count))