Beebs.systap added a comment.

In https://phabricator.wikimedia.org/T88717#1037229, @Smalyshev wrote:

> Is there a way to to traversals and aggregation in SPARQL? I.e. Cypher 
> examples:
>
> This is list of all professions. Note the '*' there:
>
>   MATCH (v:item {wikibaseId: 'Q28640'})<-[:claim|P279|P31*]-(v2:item) RETURN 
> v2.wikibaseId, v2.labelEn;
>
>
> This is list of countries by latest population data:
>
>   MATCH (v:item)-[:claim]->(c:claim:P31 {value: "Q6256"}) 
>       MATCH (v)-[:claim]->(c2:claim:P1082) WHERE has(c2.value) 
>       WITH v as v, max(c2.P585q) as latest
>       MATCH (v)-[:claim]->(cv:claim:P1082)
>       WHERE cv.P585q = latest
>       RETURN v.wikibaseId, v.labelEn, cv.value, cv.P585q
>       ORDER BY cv.value DESC
>
>
> I wonder how these would look like with SPARQL.


From Blazegraph/Bigdata developer Mike Personick:

Traversals = Property Paths

http://www.w3.org/TR/sparql11-query/#propertypaths

Lets you do * (0 or more traversal) and + (1 or more)

Also we have GAS-based BFS.

Aggregation yes, lots of support for aggregation in Sparql 1.1:

http://www.w3.org/TR/sparql11-query/#aggregates

Can do all sorts of things - min, max, avg, count, ...


TASK DETAIL
  https://phabricator.wikimedia.org/T88717

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Smalyshev, Beebs.systap
Cc: Beebs.systap, Aklapper, Manybubbles, jkroll, Smalyshev, Wikidata-bugs, 
Jdouglas, aude, GWicke, daniel, JanZerebecki



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to