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

sttl.owlqltc.axiomowlqltc.anonymous.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
# OWL 2 QL does not support anonymous individuals

template {
	?suc
}
where {
 { ?in rdf:type ?x
   FILTER(
      	?x = owl:NamedIndividual ||
   		# filter owl, xsd, rdfs, rdf
   		!(
   			STRSTARTS(?x, owl:) ||
   			STRSTARTS(?x, xsd:) ||
			STRSTARTS(?x, rdfs:) ||
			STRSTARTS(?x, rdf:) ||
			isBlank(?x)
  	    )
   )
   
   bind(!isBlank(?in) as ?suc)
   filter(! ?suc)
   filter(st:visit(st:err("anonymous"), ?in, ?suc))
 }
 
 union {
 		  ?in ?p ?x
 	  	  FILTER(
 	         !(
 	         	STRSTARTS(?p, owl:) ||
 				STRSTARTS(?p, rdfs:) ||
 				STRSTARTS(?p, rdf:)
 		  ))
 		  
 		  filter((!isBlank(?in) && !isBlank(?x)) = false)
 		  bind(!isBlank(?in) as ?sucin)
 		  bind(!isBlank(?x) as ?sucx)
 		  
 		  filter(st:visit(st:err("anonymous"), ?in, ?sucin))
 		  filter(st:visit(st:err("anonymous"), ?in, ?sucx))
  	    }
 	   
 union {	
 			# owl:differentIndividuals
 			{ ?in a owl:AllDifferent
 			  VALUES ?p { owl:distinctMembers owl:members }
 			  ?in ?p ?y
 			  ?y rdf:rest*/rdf:first ?x }
 			
      		union { ?in owl:targetIndividual ?x }
      		union { ?in owl:sourceIndividual ?x }
      		
      		# annotation
      		union { ?in owl:annotatedSource ?x }
      		union { ?in owl:annotatedTarget ?x }
      		
      		union { ?in owl:hasValue ?x }
      		
      		# if blank node return false
      		bind(!isBlank(?x) as ?suc)
      		filter(! ?suc)
      		filter(st:visit(st:err("anonymous"), ?in, ?suc))
 }
 
 union {
 	 		# owl:differentIndividuals
 			{ ?in owl:differentFrom ?x }
 			
 		    filter((!isBlank(?in) && !isBlank(?x)) = false)
 		    bind(!isBlank(?in) as ?sucin)
 		    bind(!isBlank(?x) as ?sucx)
 		    
 		    filter(st:visit(st:err("anonymous"), ?in, ?sucin))
 		  	filter(st:visit(st:err("anonymous"), ?in, ?sucx))
 }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy