I have an RDF file with several relations on it. Some of relations have transitive closure. I posted a question before about how to construct a property's transitive closure in Sparql in this link . Now I am able to construct new triples with property's transitive closure which means extracted all over the path.
For example, there is a part_of
relation, if ?a
is part_of
?b
, and ?b
is part_of
?c
, so we can infer that a
is part_of
?c
. Then I made my query like this:
construct {?a :part_of ?b} where {?a :part_of+ ?b . filter(?a != ?b) }
Then I have another transitive closure. For example, there is an is_a
relation, if ?a
is_a
?b
, and ?b
is_a
?c
, so we can infer that ?a
is_a
?c
. Then I made my query like this:
construct {?a :is_a ?b} where {?a :is_a+ ?b . filter(?a != ?b)}
And then I have another condition which is including these two transitive closure:
For example, if ?a
part_of
?b
, and ?b
is_a
?c
, so we can infer that ?a
part_of
?c
. Then could I make my query like this?
construct {?a :part_of ?c}
where {
?a :part_of+ ?b .
?b :is_a+ ?c .
filter(?a != ?c)
}