rdf - 猫头鹰 rdfs :langString and restricting its allowed languages

标签 rdf owl semantic-web ontology rdfs

在 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 .

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

关于rdf - 猫头鹰 rdfs :langString and restricting its allowed languages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49423120/

相关文章:

rdf - 关于语义网、RDF 和 OWL

rdf - 奇怪的 Apache Jena 可选行为

java - 如何修改或删除属性值? - 耶拿 API

jena - 将 OWLAPI 中的本体与相同的 IRI 合并

rdf - 将 rdf 三元组加载到 virtuoso 开源中

parsing - 如何将 Apache Any23 RDF 语句添加到 Apache Jena?

java - 如何在Java中根据主题划分RDF三元组

semantic-web - 是否可以用 OWL 表示充分条件关系?

html - HTML5 对语义标记和语义网技术提供了哪些支持?

java - 如何提取rdf :about or rdf:ID properties from triples using SPARQL?