这个 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 语法是什么?
最佳答案
只需使用 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.
大多数前缀都是不必要的。
关于rdf - 海龟 TTL 语法中的句点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19025182/