All Downloads are FREE. Search and download functionalities are using the official Maven repository.

query.clean.ui2.rq Maven / Gradle / Ivy

Go to download

Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1 Query and Update.

There is a newer version: 4.6.1
Show newest version
#
# Factorize all occurrences of same Union/Intersection
# into one occurrence everywhere
# [] owl:unionOf (?c1 ?c2) 
#
# Olivier Corby - Wimmics INRIA I3S - 2014 
#
delete {
  ?a ?r ?b  
  ?b ?ui ?b1
  ?b1 rdf:first ?c1 ; rdf:rest ?b2
  ?b2 rdf:first ?c2 ; rdf:rest rdf:nil
}
insert {
  ?a ?r ?y
}
where {
  # ?y is the representant of the set of similar U/I
  {select (sample(?x) as ?y) ?ui ?c1 ?c2 
  where {    
    values ?ui { owl:unionOf owl:intersectioOf }    
    ?x ?ui (?c1 ?c2)
    }
    group by ?ui ?c1 ?c2
  }
  
  ?b ?ui ?b1
  ?b1 rdf:first ?c1 ; rdf:rest ?b2
  ?b2 rdf:first ?c2 ; rdf:rest rdf:nil
  filter(?b != ?y)
  
  ?a ?r ?b
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy