Writing N3 to RDF / XML

I need to try N3 and I need to convert it to the appropriate RDF / XML format, please, any help?

 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 .
+5
source share
3 answers

You need to provide a little more information, for example. like this

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

Replace namespaces for crops and crops with the correct ones.

That would be in 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>

Here is an online conversion tool: http://www.rdfabout.com/demo/validator/

+3
source

, n3. , 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 Validator. , .

+2

If you use Jena , there is an rdfcat command line tool that can convert files between RDF / XML, N-triples and Turtle formats.

+2
source

All Articles