此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>
只会验证 并且可以使用http://www.rdfabout.com/demo/validator/转换为TTL / N3。结果是
@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.
当我尝试验证此结果并尝试将其转换回来时,由于句点,gn:A.PCLI朝向末尾未通过。什么是正确的TTL语法?
答案 0 :(得分:2)
只需使用URI表单:
@prefix gn: <http://www.geonames.org/ontology#>.
<http://sws.geonames.org/2750405/> gn:featureCode <http://www.geonames.org/ontology#A.PCLI>;
a gn:Feature.
您的大部分前缀都不是必需的。
答案 1 :(得分:0)
我会这样说:
<http://sws.geonames.org/2750405/> gn:featureCode gn:A_PCLI;
a gn:Feature.
我认为你不应该使用。在乌龟的资源标识符中。