TributaryTypeConstraint
type: NodeShape
target subjects of: hasTributary
sparql: SPARQLConstraint
  message: Objects of :hasTributary must be instances of :River
  select: PREFIX : <http://worldmind.ai/rivers-v4#> SELECT $this ?tributary WHERE { $this :hasTributary ?tributary . FILTER NOT EXISTS { ?tributary rdf:type :River . } }

SourceElevationPositiveConstraint
type: NodeShape
target class: River
sparql: SPARQLConstraint
  message: Source elevation must be positive
  select: PREFIX : <http://worldmind.ai/rivers-v4#> SELECT $this WHERE { $this :sourceElevation ?elev . FILTER (?elev <= 0) }

LengthPositiveConstraint
type: NodeShape
target class: River
sparql: SPARQLConstraint
  message: River length must be positive
  select: PREFIX : <http://worldmind.ai/rivers-v4#> SELECT $this WHERE { $this :length ?len . FILTER (?len <= 0) }

DischargePositiveConstraint
type: NodeShape
target class: River
sparql: SPARQLConstraint
  message: Discharge must be positive
  select: PREFIX : <http://worldmind.ai/rivers-v4#> SELECT $this WHERE { $this :discharge ?dis . FILTER (?dis <= 0) }

MouthElevationConstraint
type: NodeShape
target class: River
sparql: SPARQLConstraint
  message: Mouth elevation should typically be >= 0
  select: PREFIX : <http://worldmind.ai/rivers-v4#> SELECT $this WHERE { $this :mouthElevation ?mouth . FILTER (?mouth < -100) }

RiverFlowDownhillConstraint
type: NodeShape
target class: River
sparql: SPARQLConstraint
  message: Source elevation must be greater than mouth elevation
  select: PREFIX : <http://worldmind.ai/rivers-v4#> SELECT $this WHERE { $this :sourceElevation ?src . $this :mouthElevation ?mouth . FILTER (?src <= ?mouth) }

GeographicConsistencyConstraint
type: NodeShape
target subjects of: traverses
sparql: SPARQLConstraint
  message: If traversing US state, river should be in US country
  select: PREFIX : <http://worldmind.ai/rivers-v4#> PREFIX dbr: <http://dbpedia.org/resource/> SELECT $this WHERE { $this :traverses ?state . ?state rdf:type :State . FILTER NOT EXISTS { $this :inCountry dbr:United_States . } }