I am new to Semantic Web and SPARQL. I am making a RDFS of concert. It has songs entries like:
con:song04
rdfs:Class con:Repertoire;
rdfs:label "Deewani Mastani";
con:performedBy con:artist02.
con:performedBy con:artist05.
I am trying to get list of songs and their count, if they are performed by same artist. I have been trying some tutorials from stackoverflow but does not server my purpose.
The query I am using might be wrong completely, would be really helpful in learning, if someone could help me on this aspects. I am using Apache Jena Fuseki to query.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX co: <http://rhizomik.net/ontologies/copyrightonto.owl#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
prefix con: <http://www.example.com/paras/concert#>
#Use SPARQL to count and list the songs that two artists share.
SELECT ?songs (COUNT(?artist) AS ?count)
WHERE
{
?s rdfs:label ?songs .
?s rdf:type con:Repertoire.
?s con:performedBy ?artist.
?artist rdf:type con:Artist .
filter( ?count > 1 )
}