加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

N3符号表示RDF / XML

发布时间:2020-12-16 23:15:15 所属栏目:百科 来源:网络整理
导读:我必须对N3进行采样,我需要将其转换为对应的RDF / XML格式,请帮忙吗? crop:AttributeValue a rdfs:Class . crop:SomeValue a rdfs:Class; rdfs:subClassOf crops:AttributeValue . crop:SomeValue/7 a crops:SomeValue . crop:SomeValue a rdf:Property ; r
我必须对N3进行采样,我需要将其转换为对应的RDF / XML格式,请帮忙吗?

crop:AttributeValue a rdfs:Class . 
 crop:SomeValue a rdfs:Class; rdfs:subClassOf crops:AttributeValue .

 crop:SomeValue/7 a crops:SomeValue .

 crop:SomeValue a rdf:Property ; rdfs:range crops:SomeValue .

解决方法

您需要指定更多信息,例如像这样

@prefix crop: <http://example.org/foo#> .
@prefix crops: <http://example.org/foo#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/TR/rdf-schema/> .

crop:AttributeValue a rdfs:Class . crop:SomeValue a rdfs:Class; rdfs:subClassOf crops:AttributeValue .

<http://example.org/foo#SomeValue/7> a crops:SomeValue .

crop:SomeValue a rdf:Property ; rdfs:range crops:SomeValue .

用正确的名称替换作物和作物的名称空间.

这将是RDF / XML中的以下内容

<?xml version="1.0"?>
<rdf:RDF xmlns:rdfs="http://www.w3.org/TR/rdf-schema/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:crops="http://example.org/foo#">
    <rdfs:Class rdf:about="http://example.org/foo#SomeValue">
        <rdfs:subClassOf>
            <rdfs:Class rdf:about="http://example.org/foo#AttributeValue" />
        </rdfs:subClassOf>
        <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" />
        <rdfs:range rdf:resource="http://example.org/foo#SomeValue" />
    </rdfs:Class>
    <crops:SomeValue rdf:about="http://example.org/foo#SomeValue/7" />
</rdf:RDF>

以下是转换的在线工具:http://www.rdfabout.com/demo/validator/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读