relpipe-data/examples/rdf-heathers-members.sparql
author František Kučera <franta-hg@frantovo.cz>
Mon, 27 Jul 2020 17:51:53 +0200
branchv_0
changeset 310 aeda3cb4528d
permissions -rw-r--r--
examples: Querying an RDF triplestore using SPARQL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
310
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
PREFIX person:     <tag:heathers.globalcode.info,2020:person:>
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
PREFIX predicate:  <tag:heathers.globalcode.info,2020:predicate:>
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
PREFIX thing:      <tag:heathers.globalcode.info,2020:thing:>
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
SELECT
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
	?group_name
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
	(count(*) AS ?member_count)
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
WHERE {
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
	?person predicate:is-member-of ?group .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
	?group predicate:has-title ?group_name .
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
}
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
GROUP BY ?group_name
aeda3cb4528d examples: Querying an RDF triplestore using SPARQL
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
ORDER BY DESC(?member_count)