Validate OWL RL with "custom" URI

35 views
Skip to first unread message

Simon Schlosser

unread,
Mar 13, 2015, 2:44:14 PM3/13/15
to rdf...@googlegroups.com
Hi all,

I've played a bit with RDFUnit and tried to validate the following facts:

I have two business partners with a name, address and a legal form. One legal form is correct (AG), the second legal form is incorrect (AGz). Valid legal forms are only GmbH and AG as the constraint in the second snippet shows.

@prefix cdl: <http://www.myURI.xyz/rdf/'> .
 

<CDL_ID_1> a cdl:BusinessPartner ;
     cdl
:BusinessPartnerName "my Business Partner 1" ;
     cdl
:LegalForm cdl:AG ;
     cdl
:Address "Street x, Locality y" .


<CDL_ID_2> a cdl:BusinessPartner ;
     cdl
:BusinessPartnerName "my Business Partner 2" ;
     cdl
:LegalForm cdl:AGz ;
     cdl
:Address "Street z, Locality m" .

cdl
:GmbH a cdl:ValidLegalForm .
cdl
:AG a cdl:ValidLegalForm .

and I have the following "constraint":

@prefix cdl: <http://www.myURI.xyz/rdf/'> .

cdl:LegalForm rdfs:range cdl:ValidLegalForm .

Using the web demo I can provide the first snippet as input and then load the second snippet which is my constraint ("Direct Input"). However, no tests are generated.

Is it due to
a) my input is wrong?
b) I understand the functionality wrongly and can only validate ontologies that use LOV schemas?

Sorry if this question is maybe totally silly but I'm very interested in finding out if I can use RDFUnit for validating simple data quality issues using OWL RL as in my example!

Thanks,
Simon


Dimitris Kontokostas

unread,
Mar 14, 2015, 10:52:19 AM3/14/15
to Simon Schlosser, rdfunit
Hi Simon,

the trick is to add  "cdl:ValidLegalForm  a rdfs:Class. " in your input.
I require the ontology to be 'complete' in order to process it and I don't use any reasoning in RDFUnit. 

Let me know if you have more questions

Best,
Dimtiris

--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/c23e22fc-e1b0-43cb-9c10-781855d9fd3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kontokostas Dimitris

Simon Schlosser

unread,
Mar 14, 2015, 2:35:08 PM3/14/15
to rdf...@googlegroups.com, simonr.s...@gmail.com
Hey Dimitris,

thank you very much! Now it works as expected. I need to dive deeper into RDFUnit and will try to integrate it in my application. So, no further questions in the moment!

Thanks again for the fast response!

Best,
Simon

Simon Schlosser

unread,
May 19, 2015, 2:42:44 PM5/19/15
to rdf...@googlegroups.com
Hi Dimitris,
I've used RDFUnit for relatively simple validation tasks. Now I'm trying to get a more complicated example running (even though it seemed so simple for me in the beginning ...). Could you please have a look on it as I assume that this is something RDFUnit does not (yet) support... but maybe (or better hopefully) I am wrong :)

The task is the following: 
- I have hundreds of legal forms that are of rdf:type Category-3ALegal_form.
- Each legal form has an object property Property-3AUsed_in which specifies the country where the legal form is "allowed"
- A business partner has a location in a country and a legal form 
What I want to test is whether a business partner instance has a legal form that is valid in the country he is located in! 

Here is the example which I reduced to a minimum (e.g. the country of the business partner is not specified as I assume here that the legal form always has to be a valid legal form in Germany)

First my dataset which describes 3 legal forms followed by a description of their usage countries. Then, there is an instance of a business partner with legal form Aktiengesellschaft and finally I define the class German Legal Form which comprises all legal forms that are used in Germany... (this is the problematic part... I also tried to work with owl:intersectionOf combined with owl:allValuesFrom)

<http://cdq.ch/metadata/Aktiengesellschaft> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://cdq.ch/metadata/Category-3ALegal_form> .
<http://cdq.ch/metadata/GmbH> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://cdq.ch/metadata/Category-3ALegal_form> .

<http://cdq.ch/metadata/Persekutuan_Komanditer> <http://cdq.ch/metadata/Property-3AUsed_in> <http://cdq.ch/metadata/Indonesia> .
<http://cdq.ch/metadata/Aktiengesellschaft> <http://cdq.ch/metadata/Property-3AUsed_in> <http://cdq.ch/metadata/Germany> .
<http://cdq.ch/metadata/GmbH> <http://cdq.ch/metadata/Property-3AUsed_in> <http://cdq.ch/metadata/Germany> .


<CDL_12345_ID> rdf:type <http://cdq.ch/metadata/Business_Partner> ;
<http://cdq.ch/metadata/Property-3ALegal_form> <http://cdq.ch/metadata/Aktiengesellschaft>.  


<http://cdq.ch/metadata/German_Legal_Form> a owl:Class ;
rdfs:subClassOf [
rdf:type owl:Restriction;
owl:onProperty <http://cdq.ch/metadata/Property-3AUsed_in> ;
owl:hasValue <http://cdq.ch/metadata/Germany>
] .




And here are the constraints. First, there is a check that there is a value specified for the property legal form (works well) and at the end there is a out commented check whether the property is a legal form (works well too). In between there is the problematic check... I want to ensure that the Property Property-3ALegal_form is in the range of German Legal Form... This check does not work properly... 

                                                      

a owl:Class ;
rdfs:subClassOf [               # ex:cardExact1 exactly 1
        rdf:type owl:Restriction;
        owl:onProperty <http://cdq.ch/metadata/Property-3ALegal_form>;
        owl:cardinality "1"^^xsd:nonNegativeInteger
    ] . 




If I run this I get the result that "Aktiengesellschaft" is not in the right range, it should though. I assume that it is not known by RDFUnit what a German Legal Form is (maybe wrong definition of the class) or this is in general not supported by RDFUnit? It makes no difference whether I put the definition to the constraints or not... Do you have an idea on this? Maybe, there is a nice workaround?

Thanks for your help!

Simon

Simon Schlosser

unread,
May 19, 2015, 2:46:36 PM5/19/15
to rdf...@googlegroups.com
Changed namespace
# a owl:Class .
#<http://cdq.ch/metadata/Property-3ALegal_form> rdfs:range <http://cdq.ch/metadata/Category-3ALegal_form> .


Dimitris Kontokostas

unread,
May 20, 2015, 3:03:21 PM5/20/15
to Simon Schlosser, rdfunit

Simon Schlosser

unread,
May 26, 2015, 2:51:19 PM5/26/15
to rdf...@googlegroups.com, simonr.s...@gmail.com
Hi Dimitris,

as expected I've explained it badly :)
I want to check if it's really a legal form that is allowed in Germany (in this case) and not only if it is an existing legal form in any country (this works fine with the range axiom). Thus, I try to create a German_Legal_Form class which infers all allowed legal forms by asking the "Used in"-Property from all existing legal forms. 

Now, some thoughts later I think that I have to run a reasoner first that infers the German legal forms. But I've not tried it yet.

Best,
Simon

Simon Schlosser

unread,
May 26, 2015, 2:51:29 PM5/26/15
to rdf...@googlegroups.com, simonr.s...@gmail.com
Hi Dimitris,

as expected I've explained it badly :)
I want to check if it's really a legal form that is allowed in Germany (in this case) and not only if it is an existing legal form in any country (this works fine with the range axiom). Thus, I try to create a German_Legal_Form class which infers all allowed legal forms by asking the "Used in"-Property from all existing legal forms. 

Now, some thoughts later I think that I have to run a reasoner first that infers the German legal forms. But I've not tried it yet.

Best,
Simon

Am Mittwoch, 20. Mai 2015 21:03:21 UTC+2 schrieb Dimitris Kontokostas:

Dimitris Kontokostas

unread,
Jun 5, 2015, 2:43:34 AM6/5/15
to Simon Schlosser, rdfunit
Sorry for the delayed reply, I was travelling.

Firstly, owl:hasValue is not yet implemented in RDFUnit although it is easy to do. I'll add an issue on this

yes, RDFUnit does not perform any reasoning so if you need that you should do it prior validation.
Reasoning would fill some soft errors like missing ranges etc but in some case could hide some other errors. So RDFS reasoning should be safe in most cases but owl reasoning might not

Best,
DImitris

--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Kontokostas Dimitris
Reply all
Reply to author
Forward
0 new messages