Name: cypher-examples
Owner: Histograph
Description: Selection of example Cypher queries for Histograph data
Created: 2015-08-13 09:30:36.0
Updated: 2015-08-13 09:30:36.0
Pushed: 2015-10-20 13:01:18.0
Homepage: null
Size: 136
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Selection of example Cypher queries for Histograph data. Expects a Neo4j instance with Histograph data from the following two sources:
Example queries:
H (c:`=`)
ONAL MATCH c --> n
RN c,
unt(distinct n) AS cn,
llect(DISTINCT n.name) AS names
R BY cn DESC LIMIT 10;
H
:_)
E NOT p:_Rel AND NOT p:`=` AND NOT p:`=i`
RN DISTINCT
dataset AS dataset,
type AS type,
UNT(p) AS count
ind source and target nodes
H (m:_) WHERE m.id = "urn:hg:tgn:1047973"
H (n:_) WHERE n.id = "urn:hg:tgn:7016845"
ind corresponding equivalence classes (ECs)
ONAL MATCH m <-[:`=`]- (mConcept:`=`)
ONAL MATCH n <-[:`=`]- (nConcept:`=`)
hoose the right node (EC if there, otherwise only member)
coalesce(nConcept, n) AS to,
coalesce(mConcept, m) AS from
nsure we have a path
H p = allShortestPaths(from -[:`hg:liesIn`|`=`|`=i` * 1 .. 5]-> to)
RN p
ind target nodes
H (n:_) WHERE n.id = "urn:hg:gemeentegeschiedenis:Berkelland"
ind corresponding equivalence classes (ECs)
ONAL MATCH n <-[:`=`]- (nConcept:`=`)
hoose the right node (EC if there, otherwise only member)
coalesce(nConcept, n) AS to
ind `hg:absorbedBy` paths
H p = allShortestPaths(from -[:`hg:absorbedBy`|`=`|`=i` * 1 .. 5]-> to)
etch all nodes in path
ND(nodes(p)) as k
H k
elect only non-relation nodes
E NOT k:_Rel AND NOT k:`=`
RN DISTINCT k.name, k.id, k.validSince, k.validUntil
R BY k.validUntil
ind target nodes
H (n:_) WHERE n.id = "urn:hg:geonames:2756134"
ind corresponding equivalence classes (ECs)
ONAL MATCH n <-[:`=`]- (nConcept:`=`)
hoose the right node (EC if there, otherwise only member)
coalesce(nConcept, n) AS to
ind paths
H (place:`hg:Place`) -[:`hg:liesIn`|`=`|`=i` * 3 .. 3]-> to
RN DISTINCT place.name, place.id
Copyright © 2015 Waag Society.