AKSW / RDFUnit

An RDF Unit Testing Suite
http://RDFUnit.aksw.org
Apache License 2.0
150 stars 42 forks source link

owl:complementOf Autogenerator fails on anonymous class declarations for the complement #38

Closed neradis closed 8 years ago

neradis commented 8 years ago

One example of problematic schema specification from the current NIF Core ontology:

nif:lang
    a owl:ObjectProperty ;
    # ommisions for brevity
    rdfs:domain [ rdf:type owl:Class ; owl:complementOf nif:Context ] .

When the autogenerator tries to generate the ?DESCRIPTION, this fails with the Jena SPARQL engine (probably because it cannot come up with a str(...) value for a bound blank node in ?T1:

    rut:sparqlGenerator """ SELECT DISTINCT ?T1 ?T2 ?DESCRIPTION WHERE {
                             ?T1 owl:complementOf ?T2 . 
                             BIND ( concat(str(?T1)," is owl:complementOf with ", str(?T2)) AS ?DESCRIPTION)} """ ;
    rut:basedOnPattern rutp:OWLDISJC ;

Resulting in the error message: [ERROR TestAutoGenerator] No ?DESCRIPTION variable found in AutoGenerator: http://rdfunit.aksw.org/data/generators#OWLCOMPL

neradis commented 8 years ago

I pushed a suggested adjustment for for the OWLCOMPL generator that handles the aforementioned anonymous complement classes without error in 314aedd92494424f3859c94793af487567444992

jimkont commented 8 years ago

Thanks for the PR but I usually skip the tests with blank nodes as the cannot actually run on the datasets e.g. https://github.com/AKSW/RDFUnit/blob/master/configuration/autoGeneratorsOWL.ttl#L42 so I'd change that to FILTER (!isBlank(?T1) && !isBlank(?T2) )