buda-base / owl-schema

BDRC Ontology Schema
11 stars 2 forks source link

Error using rdf:langString in union class expression #180

Closed rjyounes closed 3 years ago

rjyounes commented 3 years ago

I tracked down the Protege error to this code:

bdo:LangStringOrNoColophon
    a rdfs:Datatype ;
    owl:equivalentClass [
        a rdfs:Datatype ;
        owl:unionOf (
            bdo:NoColophon
            rdf:langString
        ) ;
    ] ;
    .

The following also generates an error:

bdo:LangStringOrNoColophon
    a rdfs:Datatype ;
    owl:equivalentClass [
        a rdfs:Datatype ;
        owl:unionOf (
            rdf:langString
        ) ;
    ] ;
    .

As does

bdo:LangStringOrNoColophon
    a rdfs:Datatype ;
    owl:equivalentClass [
        a rdfs:Datatype ;
        owl:unionOf (
            xsd:integer
            rdf:langString
        ) ;
    ] ;
    .

The following does not generate an error is

bdo:LangStringOrNoColophon
    a rdfs:Datatype ;
    owl:equivalentClass rdf:langString ;
    .

owl:intersectionOf produces the same results. That is, an error is generated if and only if rdf:langString is used in a list.

eroux commented 3 years ago

ah, thanks a lot for that!! We can remove this, but I think the original intent was to say that the range of bdo:colophon was either a xsd:integer or rdf:langString... out of curiosity, is there a was to express that?

rjyounes commented 3 years ago

Unfortunately, I have no idea what's wrong with it. I've sent a message to my Semantic Arts colleagues asking if anyone can explain it. I forgot to mention that the error is generated in Protege but not rdf-toolkit, so it could be a Protege problem.

eroux commented 3 years ago

oh wait, I think Protege is only using RDF 1.0 in which rdf:langString is rdf:PlainLiteral, because it uses an owl java library that doesn't handle RDF 1.1... I think it was a major reason why we didn't want to use it

rjyounes commented 3 years ago

It appears that RDF 1.0 didn't define rdf:langString at all: https://www.w3.org/TR/rdf11-new/.

However, yes, it could be some Protege oddity. We should probably ignore it.

rjyounes commented 3 years ago

Actually, Protege 5.5, which I'm using, does use RDF 1.1, so it's still not clear what causes this error.

eroux commented 3 years ago

ah, I'm glad they finally updated that! Well, as I said, you can remove this piece of code, we won't use it anymore as we're transitionning to shacl

rjyounes commented 3 years ago

Oh, I see what you're asking above about the range of bdo:colophon. Yes, there is a way to express a union domain in OWL. I will make that change and remove the LangStringOrNoColophon datatype.

rjyounes commented 3 years ago

Fixed.

eroux commented 3 years ago

thanks!