Sparql endpoint/Maintenance

From Openresearch
Revision as of 17:23, 21 February 2017 by Sahar (talk | contribs) (Created page with "===== Find all event series all/most of whose events have less than N properties? ===== <pre> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Find all event series all/most of whose events have less than N properties?
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX smwont: <http://data.semanticweb.org/ns/swc/ontology#>
PREFIX property: <http://openresearch.org/Special:URIResolver/Property-3A>

SELECT ?series
  (COUNT(DISTINCT ?event) AS ?eventCount)
  (SUM(?propertyCount) as ?propertySum)
  ((?propertySum / ?eventCount) AS ?avgPropPerEvt)
WHERE
{
?event property:Event_in_series ?series .
{
SELECT ?event (COUNT(DISTINCT ?p) AS ?propertyCount) WHERE {
?event a smwont:ConferenceEvent .
?event ?p ?o .
} GROUP BY ?event ?series
}
} 
GROUP BY ?series
HAVING (?avgPropPerEvt < 25)
ORDER BY (?avgPropPerEvt)
LIMIT 10