OWL rdfs:langString 并限制其允许的语言

OWL rdfs:langString and restricting its allowed languages

是否可以在 OWL 中限制 属性 的范围如

demo:property rdfs:range rdf:langString

以便我们只允许 "en" 和 "de" 作为语言?

所以

demo:object demo:property "hello"@en

可以,但是

demo:object demo:property "bonjour"@fr

不会。

来自4.3 Strings

The OWL 2 datatype map provides the rdf:PlainLiteral datatype for the representation of strings in a particular language. The definitions of the value space, the lexical space, the facet space, and the necessary mappings are given in [RDF:PLAINLITERAL]. The normative constraining facets for rdf:PlainLiteral are xsd:length, xsd:minLength, xsd:maxLength, xsd:pattern, and rdf:langRange; furthermore, only basic language ranges [BCP 47] are supported in the rdf:langRange constraining facet.

因此,在曼彻斯特语法中:

DataProperty: demo:property
    Range: 
        (rdf:PlainLiteral[langRange "de"] or rdf:PlainLiteral[langRange "en"]

在海龟中:

demo:property a owl:DatatypeProperty ;
    rdfs:range [ rdf:type rdfs:Datatype ;
        owl:unionOf ( [ rdf:type rdfs:Datatype ;
                        owl:onDatatype rdf:PlainLiteral ;
                        owl:withRestrictions ( [ rdf:langRange "de" ] )
                      ]
                      [ rdf:type rdfs:Datatype ;
                        owl:onDatatype rdf:PlainLiteral ;
                        owl:withRestrictions ( [ rdf:langRange "en" ] )
                      ]
                    )
                ] .

现在创建 3 个个体(在 Turtle 中):

demo:object_en a owl:NamedIndividual ;
               demo:property "demo"@en .

demo:object_de a owl:NamedIndividual ;
               demo:property "demo"@de .

demo:object_fr a owl:NamedIndividual ;
               demo:property "demo"@fr .

然后启动一个推理机并研究不一致的解释。