Question

This RDF/XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:gn="http://www.geonames.org/ontology#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#">
<gn:Feature rdf:about="http://sws.geonames.org/2750405/">
    <gn:featureCode rdf:resource="http://www.geonames.org/ontology#A.PCLI"/>


</gn:Feature>

validates and can be converted to TTL/N3 with http://www.rdfabout.com/demo/validator/ . The result is

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix gn: <http://www.geonames.org/ontology#>.
@prefix cc: <http://creativecommons.org/ns#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix wgs84_pos: <http://www.w3.org/2003/01/geo/wgs84_pos#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix dcterms: <http://purl.org/dc/terms/>.
<http://sws.geonames.org/2750405/> gn:featureCode gn:A.PCLI;
a gn:Feature.

When I try to validate this result and try to convert it back, the gn:A.PCLI towards the end does not pass because of the period. What is the correct TTL syntax ?

Was it helpful?

Solution

Just use the URI form:

@prefix gn: <http://www.geonames.org/ontology#>.
<http://sws.geonames.org/2750405/> gn:featureCode <http://www.geonames.org/ontology#A.PCLI>;
   a gn:Feature.

Most of your prefixes are not necessary.

OTHER TIPS

I would say this:

<http://sws.geonames.org/2750405/> gn:featureCode gn:A_PCLI;
     a gn:Feature.

I think you're not supposed to use . in the resource identifier in turtle.

http://www.w3.org/TR/turtle/#sec-grammar

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top