Open LloydRutledge opened 9 years ago
Currently, FresnelForms indeed treats datatype ranges as datatype properties. OWL API, the API that's used by Protégé, is able to differentiate between different 'types' of datatype ranges. In r595 I think I at least fixed the Runtime Exception by using only ranges of type DataType. I've left some room for the other types of datatype ranges (specifically for owl:oneOf), so this could be the way to go for implementing the feature.
I'm currently not able to test it yet, but it doesn't seem to break anything. @LloydRutledge, are you able to build FresnelForms from svn and test it yourself, or do you have an ontology prepared with which I can test this? @TeunTheunissen, could you review?
So, to be clear, this doesn't implement the owl:oneOf feature yet because the FresnelForms framework currently only saves ranges of type DataType. To implement the feature, at least the enumerated values must be kept somewhere (probably in a sub- or sibling class of ontology.DataType) for them to be able to be used in the owf:oneOf Fresnel output and subsequently in the [[Allows value::]] MediaWiki tags, but as you hinted, we won't be able to pick this up in the coming two weeks because we're in the finishing process of our thesis.
The whole RDF code from a file that causes this bug is:
@prefix : http://www.semanticweb.org/lru/ontologies/2015/4/untitled-ontology-191# . @prefix owl: http://www.w3.org/2002/07/owl# . @prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# . @prefix xml: http://www.w3.org/XML/1998/namespace . @prefix xsd: http://www.w3.org/2001/XMLSchema# . @prefix rdfs: http://www.w3.org/2000/01/rdf-schema# . @base http://www.semanticweb.org/lru/ontologies/2015/4/untitled-ontology-191 .
http://www.semanticweb.org/lru/ontologies/2015/4/untitled-ontology-191 rdf:type owl:Ontology .
################################################################# #
# #################################################################
:enumTest rdf:type owl:DatatypeProperty ;
rdfs:domain :EnumTest ;
rdfs:range [ rdf:type rdfs:Datatype ;
owl:oneOf [ rdf:type rdf:List ;
rdf:first "No" ;
rdf:rest [ rdf:type rdf:List ;
rdf:first "Yes" ;
rdf:rest rdf:nil
]
]
] .
################################################################# #
# #################################################################
:EnumTest rdf:type owl:Class .
Alex, I also e-mailed you the file directly. Is there a place on Github to put such files?
Beste Alex,
Hierbij een bestand voor de bugfixtest.
Met vriendelijke groet, Lloyd
Alex Mekkering schreef op 11-5-2015 om 13:47:
Currently, FresnelForms indeed treats datatype ranges as datatype properties. OWL API, the API that's used by Protégé, is able to differentiate between different 'types' of datatype ranges. In r595 I think I at least fixed the Runtime Exception by using only ranges of type DataType. I've left some room for the other types of datatype ranges (specifically for owl:oneOf), so this could be the way to go for implementing the feature. [https://cloud.githubusercontent.com/assets/9436555/7563873/b68434d0-f7e1-11e4-8937-b8255bfd8178.png]https://cloud.githubusercontent.com/assets/9436555/7563873/b68434d0-f7e1-11e4-8937-b8255bfd8178.png
I'm currently not able to test it yet, but it doesn't seem to break anything. @LloydRutledgehttps://github.com/LloydRutledge, are you able to build FresnelForms from svn and test it yourself, or do you have an ontology prepared with which I can test this? @TeunTheunissenhttps://github.com/TeunTheunissen, could you review?
So, to be clear, this doesn't implement the owl:oneOf feature yet because the FresnelForms framework currently only saves ranges of type DataType. To implement the feature, at least the enumerated values must be kept somewhere (probably in a sub- or sibling class of ontology.DataType) for them to be able to be used in the owf:oneOf Fresnel output and subsequently in the [[Allows value::]] MediaWiki tags, but as you hinted, we won't be able to pick this up in the coming two weeks because we're in the finishing process of our thesis.
— Reply to this email directly or view it on GitHubhttps://github.com/ABI-Team-30/Fresnel-Forms/issues/77#issuecomment-100882863.
Deze e-mail is uitsluitend bestemd voor de geadresseerde(n). Verstrekking aan en gebruik door anderen is niet toegestaan. Open Universiteit sluit iedere aansprakelijkheid uit die voortvloeit uit elektronische verzending. Aan de inhoud van deze e-mail en/of eventueel toegevoegde bijlagen kunnen geen rechten worden ontleend.
This e-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any person other than the addressee(s). Open Universiteit rules out any and every liability resulting from any electronic transmission. No rights may be derived from the contents of this message.
@prefix : http://www.semanticweb.org/lru/ontologies/2015/4/untitled-ontology-191# . @prefix owl: http://www.w3.org/2002/07/owl# . @prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# . @prefix xml: http://www.w3.org/XML/1998/namespace . @prefix xsd: http://www.w3.org/2001/XMLSchema# . @prefix rdfs: http://www.w3.org/2000/01/rdf-schema# . @base http://www.semanticweb.org/lru/ontologies/2015/4/untitled-ontology-191 .
http://www.semanticweb.org/lru/ontologies/2015/4/untitled-ontology-191 rdf:type owl:Ontology .
################################################################# #
# #################################################################
:enumTest rdf:type owl:DatatypeProperty ;
rdfs:domain :EnumTest ;
rdfs:range [ rdf:type rdfs:Datatype ;
owl:oneOf [ rdf:type rdf:List ;
rdf:first "No" ;
rdf:rest [ rdf:type rdf:List ;
rdf:first "Yes" ;
rdf:rest rdf:nil
]
]
] .
################################################################# #
# #################################################################
:EnumTest rdf:type owl:Class .
Thanks for the test file, the change I made at least solved the RuntimeException.
You could've also created a file in i.e. https://github.com/ABI-Team-30/Fresnel-Forms/tree/master/Ontologies and fill it with the RDF. That's where more test ontologies are situated also. When, in the future, you'd decide to go and use Git instead of Svn for version control, you'd be able to directly refer to that file somwhere in Git.
I just added a feature request to OWFdev.xsls for data type enumeration. This involves processing data type range owl:oneOf's into a new Fresnel owf:oneOf construct that then become [[Allows value::]] in SMW and then a pull-down menu by default in Semantic Forms.
Within this feature is a bug report: data tytpe range owl:oneOf's cause a Protégé error that crashes the FForms tab. It doesn't crash Protégé as a whole, so it may be that FForms calls a function that it shouldn't. In addition, the error message only appears once you click the FForms tab.
Specifically, this RDF causes it:
:enum rdf:type owl:DatatypeProperty ; rdfs:range [ rdf:type rdfs:Datatype ; owl:oneOf [ rdf:type rdf:List ; rdf:first "No" ; rdf:rest [ rdf:type rdf:List ; rdf:first "Yes" ; rdf:rest rdf:nil ] ] ] .
The error message is:
Error 1 Logged at Mon May 11 11:35:30 CEST 2015 OWLRuntimeException: Not a data type! uk.ac.manchester.cs.owl.owlapi.OWLDataOneOfImpl.asOWLDatatype(OWLDataOneOfImpl.java:99) nl.ou.fresnelforms.ontology.DataType.(DataType.java:21)
nl.ou.fresnelforms.main.OWLImport.matchDataPropertiesWithClasses(OWLImport.java:397)
nl.ou.fresnelforms.main.OWLImport.initializeOntology(OWLImport.java:85)
nl.ou.fresnelforms.main.OWLImport.getActiveOntology(OWLImport.java:62)
nl.ou.fresnelforms.main.Controller.(Controller.java:40)
nl.ou.fresnelforms.view.FresnelFormsViewComponent.initialiseOWLView(FresnelFormsViewComponent.java:48)
My guess is that " rdf:type rdfs:Datatype ; owl:oneOf ... " causes it. Yeah, owl:oneOf is indeed not a valid (property for a) datatype. Maybe the rest of Protégé knows to check that the datatype isn't "owl:oneOf" (among others?) before passing it to uk.ac.manchester.cs.owl.owlapi.OWLDataOneOfImpl.asOWLDatatype . Or maybe it's a Protégé bug because the function should accept oneOf as a valid RDFS data type, and the Protégé folk are avoiding the problem instead of fixing it. Maybe if FForms makes that same check than the bug is fixed. And then the location in the code for that fix is probably also the starting point for encoding the feature.
ABI team 30: this bug fix then feature request hits all three guru-levels and seems too broad to fit in your development time frame (correct me if I'm wrong ;) ). Tho any insights you could give would be helpful and appreciated. I'm writing issues in English from now on for a potentially growing group of involved developers.