import "/std/ns.rql"; import "/std/rdfs.rql"; session.namespaces["ex"] = "http://www.aifb.uni-karlsruhe.de/WBS/pha/rdf-query/sample.rdf#"; session.namespaces["top"] = "http://daml.umbc.edu/ontologies/topic-ont#"; var url = "http://www.aifb.uni-karlsruhe.de/WBS/pha/rdf-query/queries/sample.rdf"; var ds = new datasource(); ds.insert(new datasource("inet?parsetype=rdf&url=" + server.urlencode(url), session.namespaces["ex"])); //6.Count the number of authors of a publication. select ?cnt using #ds rulebase rdfs where {[rdf:type] ?s [ex:Publication]} and {[ex:author] ?s ?l} and {?li ?l ?i} and {[ex:name] ?i ?n} and groupby(?s) (?cnt=count(?n));