我必须采样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 .发布于 2011-07-08 00:06:37
您需要指定更多信息,例如如下所示
@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/
发布于 2011-07-08 00:08:04
您应该首先检查数据是否具有有效的n3表示。例如,您使用名为crop的前缀和名为crops的前缀。假设这些都是正确的,您还需要定义您的前缀(crop、crops、rdf、rdfs)。一个有效的例子是:
@prefix crop: <http://crop.org> .
@prefix crops: <http://crops.org> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
crop:AttributeValue a rdfs:Class . crop:SomeValue a rdfs:Class; rdfs:subClassOf crops:AttributeValue .
crop:SomeValue a crops:SomeValue .
crop:SomeValue a rdf:Property ; rdfs:range crops:SomeValue .对于验证和转换,您可以查看RDF About验证器。或者,您也可以使用this工具。
https://stackoverflow.com/questions/6612525
复制相似问题