2013-09-26 23 views
2

這RDF/XML週期在龜TTL語法

<?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> 

驗證 和可被轉化爲TTL/N3與http://www.rdfabout.com/demo/validator/。其結果是

@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語法?

回答

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. 

你大部分的前綴是沒有必要的。