jena - sparql to retrieve the value of a min constraint -
how can retrieve min constraint on class' attribute using sparql? have value min 1000 decimal
, , 1000
in hypothetical world have such statement:
class: x subclassof: hasobjectproperty min 1 y
if write sparql query as:
select * { ?s rdfs:subclassof ?o. }
you must extract refs:subclassof
axioms. however, if need precise , know ones have cardinality restrictions, need go further:
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix : <http://example.com#> select * { ?s rdfs:subclassof ?o. ?o ?x ?y. filter(?s = :x) }
among others, can see following result:
as can see, there 2 relevant items, 1 y
, 1 number presented non-negative integer. therefore, 1 way each item put filter ?x
in sparql query , each 1 one 1 out. example, filter owl:onclass
give ?y
:
prefix : <http://example.com#> select * { ?s rdfs:subclassof ?o. ?o owl:onclass ?y. filter(?s = :x)
Comments
Post a Comment