Difference between revisions of "SPARQL Conferences"

From BITPlan cr Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<source lang='bash'>
 
<source lang='bash'>
# SPARQL related conference series
+
# SPARQL Query to Retrieve Details of Key Academic Conferences Related to the Semantic Web and Knowledge Representation
SELECT ?conference ?conferenceLabel ?title ?officialHomepage ?descriptionURL ?dblpVenueID WHERE {
+
# This query fetches essential information about each conference series including its title, official homepage, DBLP venue ID,
 +
# and a concatenated list of main subjects. The information is sourced from the Wikidata entries for each conference.
 +
 
 +
SELECT  
 +
  ?conference  
 +
  ?conferenceLabel  
 +
  ?title  
 +
  ?officialHomepage  
 +
  ?descriptionURL  
 +
  ?dblpVenueID  
 +
  (GROUP_CONCAT(DISTINCT ?mainSubjectLabel; separator=", ") AS ?allMainSubjects)
 +
WHERE {
 +
  # Define the specific conferences of interest with their Wikidata IDs
 +
  VALUES ?conference {
 +
    wd:Q6053150    # ISWC
 +
    wd:Q17012957  # ESWC
 +
    wd:Q64852380  # K-CAP
 +
    wd:Q105491170  # EKAW
 +
    wd:Q3570023    # WWW
 +
  }
 +
 
 +
  # Fetch labels for all entities in English
 +
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
 +
 
 +
  # Retrieve optional properties for each conference
 +
  OPTIONAL { ?conference wdt:P1476 ?title. }  # Title of the series
 +
  OPTIONAL { ?conference wdt:P856 ?officialHomepage. }  # Official homepage
 +
  OPTIONAL { ?conference wdt:P973 ?descriptionURL. }  # Described at URL (Property P973)
 +
  OPTIONAL { ?conference wdt:P8926 ?dblpVenueID. }  # DBLP venue ID
 +
  OPTIONAL { ?conference wdt:P921 ?mainSubject. } # main subject
 +
}
 +
GROUP BY ?conference ?conferenceLabel ?title ?officialHomepage ?descriptionURL ?dblpVenueID
 +
ORDER BY ?conferenceLabel
 +
</source>
 +
 
 +
versus
 +
<source lang='sparql'>
 +
# SPARQL Query to Retrieve Details of Key Academic Conferences Related to the Semantic Web and Knowledge Representation
 +
# This query fetches essential information about each conference series including its title, official homepage, DBLP venue ID,
 +
# and a concatenated list of main subjects. The information is sourced from the Wikidata entries for each conference.
 +
 
 +
SELECT
 +
  ?conference
 +
  ?conferenceLabel
 +
  ?title
 +
  ?officialHomepage
 +
  ?descriptionURL
 +
  ?dblpVenueID
 +
  (GROUP_CONCAT(DISTINCT ?mainSubjectLabel; separator=", ") AS ?allMainSubjects)
 +
WHERE {
 +
  # Define the specific conferences of interest with their Wikidata IDs
 
   VALUES ?conference {  
 
   VALUES ?conference {  
 
     wd:Q6053150    # ISWC  
 
     wd:Q6053150    # ISWC  
Line 7: Line 57:
 
     wd:Q64852380  # K-CAP
 
     wd:Q64852380  # K-CAP
 
     wd:Q105491170  # EKAW
 
     wd:Q105491170  # EKAW
     wd:Q3570023 # WWW
+
     wd:Q3570023   # WWW
 
   }  
 
   }  
  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
+
  # Fetch labels for all entities in English
 +
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  
 +
  # Retrieve optional properties for each conference
 
   OPTIONAL { ?conference wdt:P1476 ?title. }  # Title of the series
 
   OPTIONAL { ?conference wdt:P1476 ?title. }  # Title of the series
 
   OPTIONAL { ?conference wdt:P856 ?officialHomepage. }  # Official homepage
 
   OPTIONAL { ?conference wdt:P856 ?officialHomepage. }  # Official homepage
 
   OPTIONAL { ?conference wdt:P973 ?descriptionURL. }  # Described at URL (Property P973)
 
   OPTIONAL { ?conference wdt:P973 ?descriptionURL. }  # Described at URL (Property P973)
 
   OPTIONAL { ?conference wdt:P8926 ?dblpVenueID. }  # DBLP venue ID
 
   OPTIONAL { ?conference wdt:P8926 ?dblpVenueID. }  # DBLP venue ID
}
+
  OPTIONAL {
 +
    ?conference wdt:P921 ?mainSubject.
 +
    ?mainSubject rdfs:label ?mainSubjectLabel.
 +
    FILTER(LANG(?mainSubjectLabel) = "en")
 +
  }
 +
}
 +
GROUP BY ?conference ?conferenceLabel ?title ?officialHomepage ?descriptionURL ?dblpVenueID
 
ORDER BY ?conferenceLabel
 
ORDER BY ?conferenceLabel
 
</source>
 
</source>

Revision as of 09:59, 11 July 2024

# SPARQL Query to Retrieve Details of Key Academic Conferences Related to the Semantic Web and Knowledge Representation
# This query fetches essential information about each conference series including its title, official homepage, DBLP venue ID, 
# and a concatenated list of main subjects. The information is sourced from the Wikidata entries for each conference.

SELECT 
  ?conference 
  ?conferenceLabel 
  ?title 
  ?officialHomepage 
  ?descriptionURL 
  ?dblpVenueID 
  (GROUP_CONCAT(DISTINCT ?mainSubjectLabel; separator=", ") AS ?allMainSubjects) 
WHERE {
  # Define the specific conferences of interest with their Wikidata IDs
  VALUES ?conference { 
    wd:Q6053150    # ISWC 
    wd:Q17012957   # ESWC
    wd:Q64852380   # K-CAP
    wd:Q105491170  # EKAW
    wd:Q3570023    # WWW
  } 

  # Fetch labels for all entities in English
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }

  # Retrieve optional properties for each conference
  OPTIONAL { ?conference wdt:P1476 ?title. }  # Title of the series
  OPTIONAL { ?conference wdt:P856 ?officialHomepage. }  # Official homepage
  OPTIONAL { ?conference wdt:P973 ?descriptionURL. }  # Described at URL (Property P973)
  OPTIONAL { ?conference wdt:P8926 ?dblpVenueID. }  # DBLP venue ID
  OPTIONAL { ?conference wdt:P921 ?mainSubject. } # main subject
} 
GROUP BY ?conference ?conferenceLabel ?title ?officialHomepage ?descriptionURL ?dblpVenueID
ORDER BY ?conferenceLabel

versus

# SPARQL Query to Retrieve Details of Key Academic Conferences Related to the Semantic Web and Knowledge Representation
# This query fetches essential information about each conference series including its title, official homepage, DBLP venue ID, 
# and a concatenated list of main subjects. The information is sourced from the Wikidata entries for each conference.

SELECT 
  ?conference 
  ?conferenceLabel 
  ?title 
  ?officialHomepage 
  ?descriptionURL 
  ?dblpVenueID 
  (GROUP_CONCAT(DISTINCT ?mainSubjectLabel; separator=", ") AS ?allMainSubjects) 
WHERE {
  # Define the specific conferences of interest with their Wikidata IDs
  VALUES ?conference { 
    wd:Q6053150    # ISWC 
    wd:Q17012957   # ESWC
    wd:Q64852380   # K-CAP
    wd:Q105491170  # EKAW
    wd:Q3570023    # WWW
  } 

  # Fetch labels for all entities in English
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }

  # Retrieve optional properties for each conference
  OPTIONAL { ?conference wdt:P1476 ?title. }  # Title of the series
  OPTIONAL { ?conference wdt:P856 ?officialHomepage. }  # Official homepage
  OPTIONAL { ?conference wdt:P973 ?descriptionURL. }  # Described at URL (Property P973)
  OPTIONAL { ?conference wdt:P8926 ?dblpVenueID. }  # DBLP venue ID
  OPTIONAL {
    ?conference wdt:P921 ?mainSubject.
    ?mainSubject rdfs:label ?mainSubjectLabel.
    FILTER(LANG(?mainSubjectLabel) = "en")
  }
} 
GROUP BY ?conference ?conferenceLabel ?title ?officialHomepage ?descriptionURL ?dblpVenueID
ORDER BY ?conferenceLabel