Skip to content

Instantly share code, notes, and snippets.

@cretep
Created May 14, 2011 19:51
Show Gist options
  • Save cretep/972561 to your computer and use it in GitHub Desktop.
Save cretep/972561 to your computer and use it in GitHub Desktop.
Combined Nomenclature 2011
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix dc: <http://purl.org/dc/elements/1.1#> .
@prefix dcterms: <http://purl.org/dc/terms#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1#> .
@prefix cn: <file:Data/cn-cwm.n3#> .
<> a skos:ConceptScheme, owl:Ontology ;
skos:prefLabel "Combined Nomenclature 2011" ;
skos:notation "CN" ;
skos:definition "Based on the UN CTO's Harmonized Commodity Description and Coding Systems (HS), the Combined Nomenclature (CN) classifies all goods imported into or exported from the EU." ;
owl:versionInfo "Revision: 0.0.1" ;
dcterms:title "Combined Nomenclature" ;
dcterms:created "2011-04-14"^^xsd:date ;
dcterms:contributor <http://sparkary.com/pc#i> ;
foaf:page <http://dbpedia.org/page/Combined_Nomenclature> ;
dcterms:subject "Products" ;
dcterms:publisher "Eurostat" ;
dcterms:source <http://ec.europa.eu/eurostat/ramon/nomenclatures/> ;
foaf:page <http://ec.europa.eu/eurostat/ramon/nomenclatures/> ;
dcterms:source <http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=ACT_OTH_CLS_DLD&StrNom=CN_2011&StrFormat=CSV&StrLanguageCode=EN&IntKey=&IntLevel=&bExport=> ;
dcterms:license <http://ec.europa.eu/geninfo/legal_notices_en.htm#copyright> .
# skos:hasTopConcept cn:total ;
<http://ec.europa.eu/geninfo/legal_notices_en.htm#copyright>
foaf:name "European Union, 1995-2011" ;
rdfs:comment "Reproduction is authorised, provided the source is acknowledged, save where otherwise stated." .
# A visualisation of the CN's first few lines:
#
# 010011000090 - Section - LIVE ANIMALS; ANIMAL PRODUCTS
# 010021000090 - Chapter - - LIVE ANIMALS
# 010100000080 - Header - - Live horses, asses, mules and hinnies
# 010110000080 - Subheader - - - Pure-bred breeding horses and asses
# 010110100080 - Class - - - - Horses
# 010110900080 - Class - - - - Other
#
#
#
# Notes:
# - See EOF for raw data sample
# - Every line is a commodity type (in the broadest sense) or group of commodity types.
# - Each country can extend the HS with extra levels specific to their needs. Many publish individually.
# - The CN is available in all European langauges, and possibly all langauges somewhere occassionally
# - The HS is available in every 'official' language in the world! Yet to find a CSV.
#
# Issues:
# - How best to annotate the hierarchy?
# - Many "commodities types" are groups of commoditiy types, thus making seeAlso links to dbpedia articles and categories awkward (many-to-one) despite their close equivilence. skos:Collection, skos:closeMatch or skos:relatedMatch might do it?
#
# "1","010011000090","I"," SECTION I - LIVE ANIMALS; ANIMAL PRODUCTS","","","LIVE ANIMALS; ANIMAL PRODUCTS","ANIMAUX VIVANTS ET PRODUITS DU RÈGNE ANIMAL","LEBENDE TIERE UND WAREN TIERISCHEN URSPRUNGS"
cn:CN2011_010011000090
a cn:levelSection ;
skos:notation "010021000090"^^cn:hs12Code ;
skos:notation "I"^^cn:hs1Code ;
skos:prefLabel "LIVE ANIMALS; ANIMAL PRODUCTS"@en-GB ;
skos:scopeNote "LIVE ANIMALS; ANIMAL PRODUCTS"@en-GB ;
skos:scopeNote "ANIMAUX VIVANTS ET PRODUITS DU RÈGNE ANIMAL"@fr ;
skos:scopeNote "LEBENDE TIERE UND WAREN TIERISCHEN URSPRUNGS"@de ;
skos:broaderTransitive cn:CN2011_010011000090 .
# "2","010021000090","01"," CHAPTER 1 - LIVE ANIMALS","","","LIVE ANIMALS","ANIMAUX VIVANTS","LEBENDE TIERE"
cn:CN2011_010021000090
a cn:levelChapter ;
skos:notation "010021000090"^^cn:hs12Code ;
skos:notation "01"^^cn:hs2Code ;
skos:prefLabel "LIVE ANIMALS"@en-GB ;
skos:scopeNote "LIVE ANIMALS"@en-GB ;
skos:scopeNote "ANIMAUX VIVANTS"@fr ;
skos:scopeNote "LEBENDE TIERE"@de ;
qb:measure cn:unitpst ;
skos:broaderTransitive cn:CN2011_010011000090 .
# "3","010100000080","0101"," Live horses, asses, mules and hinnies","","","Live horses, asses, mules and hinnies","Chevaux, ânes, mulets et bardots, vivants","Pferde, Esel, Maultiere und Maulesel, lebend"
cn:CN2011_010100000080
a cn:levelHeader ;
skos:notation "010100000080"^^cn:hs12Code ;
skos:notation "0101"^^cn:hs4Code ;
skos:prefLabel "Live horses, asses, mules and hinnies"@en-GB ;
skos:scopeNote "Live horses, asses, mules and hinnies"@en-GB ;
skos:scopeNote "Chevaux, ânes, mulets et bardots, vivants"@fr ;
skos:scopeNote "Pferde, Esel, Maultiere und Maulesel, lebend"@de ;
qb:measure cn:unitpst ;
skos:broaderTransitive cn:CN2011_010021000090 .
# "4","010110000080","0101 10","- Pure-bred breeding animals","","","Pure-bred breeding horses and asses","Chevaux et ânes, reproducteurs de race pure","Zuchtpferde und Zuchtesel, reinrassig"
cn:CN2011_010110000080
a cn:levelSubheader ;
skos:notation "010110000080"^^cn:hs12Code ;
skos:notation "010110"^^cn:hs6Code ;
skos:prefLabel "Pure-bred breeding animals"@en-GB ;
skos:scopeNote "Pure-bred breeding horses and asses"@en-GB ;
skos:scopeNote "Chevaux et ânes, reproducteurs de race pure"@fr ;
skos:scopeNote "Zuchtpferde und Zuchtesel, reinrassig"@de ;
skos:broaderTransitive cn:CN2011_010100000080 .
# "5","010110100080","0101 10 10","-- Horses","p/st","DE: Anzahl Stück; EN: Number of items; FR: Nombre de pièces","Pure-bred breeding horses","Chevaux reproducteurs de race pure","Zuchtpferde, reinrassig"
cn:CN2011_010110100080
a cn:levelClass ;
skos:notation "010110100080"^^cn:hs12Code ;
skos:notation "01011010"^^cn:hs8Code ;
skos:prefLabel "Horses"@en-GB ;
skos:scopeNote "Pure-bred breeding horses"@en-GB ;
skos:scopeNote "Chevaux reproducteurs de race pure"@fr ;
skos:scopeNote "Zuchtpferde, reinrassig"@de ;
qb:measure cn:unitpst ;
skos:broaderTransitive cn:CN2011_010110000080 .
# "5","010110900080","0101 10 90","-- Other","p/st","DE: Anzahl Stück; EN: Number of items; FR: Nombre de pièces","Pure-bred breeding asses","Ânes reproducteurs de race pure","Zuchtesel, reinrassig"
cn:CN2011_010110900080
a cn:levelClass ;
skos:notation "010110100080"^^cn:hs12Code ;
skos:notation "01011090"^^cn:hs8Code ;
skos:prefLabel "Other"@en-GB ;
skos:scopeNote "Pure-bred breeding horses"@en-GB ;
skos:scopeNote "Chevaux reproducteurs de race pure"@fr ;
skos:scopeNote "Zuchtpferde, reinrassig"@de ;
qb:measure cn:unitpst ;
skos:broaderTransitive cn:CN2011_010110100080 .
<http://example.org/catalog/sampleproduct>
a cn:CN2011_010110100080 ;
rdf:label "Sample Product" .
##############################
# Hierarchy (Schema of Schema)
cn:level
a skos:Concept ;
skos:inScheme cn: ;
rdfs:label "Level" ;
rdfs:comment "Place in hierarchy: Header, Section, Chapter, Class" .
cn:levelTotal
a cn:level ;
cn:levelNumber 0 ;
rdfs:label "Total"@en-GB ;
rdfs:comment "Base of Combined Nomenclature" .
cn:levelSection
a cn:level ;
cn:levelNumber 1 ;
rdfs:label "Section"@en-GB ;
rdfs:comment "First level of hierarchy."@en-GB ;
rdfs:subClassOf cn:levelTotal.
cn:levelChapter
a cn:level ;
cn:levelNumber 2 ;
rdfs:label "Chapter"@en-GB ;
rdfs:comment "Second level of hierarchy."@en-GB ;
rdfs:subClassOf cn:levelSection.
cn:levelHeader
a cn:level ;
cn:levelNumber 3 ;
rdfs:label "Header"@en-GB ;
rdfs:comment "Third level of hierarchy."@en-GB ;
rdfs:subClassOf cn:levelChapter .
cn:levelSubheader
a cn:level ;
cn:levelNumber 4 ;
rdfs:label "Subheader"@en-GB ;
rdfs:comment "Fourth level of hierarchy."@en-GB ;
rdfs:subClassOf cn:levelHeader .
# TODO: levelClass is a type of product, not just hierarchy
cn:levelClass
a cn:level ;
cn:levelNumber 5 ;
rdfs:label "Class"@en-GB ;
rdfs:comment "Fifth (5) level of hierarchy."@en-GB ;
rdfs:subClassOf cn:levelSubheader .
##############
# Measurements
cn:unitpst
a qb:measureType ;
rdfs:label "p/st" ;
rdfs:comment "Number of items"@en-GB ;
rdfs:comment "Anzahl Stück"@de ;
rdfs:comment "Nombre de pièces"@fr .
cn:unit100pst
a qb:measureType ;
rdfs:label "100 p/st" ;
rdfs:comment "Hundred items"@en-GB ;
rdfs:comment "Hundert Stück"@de ;
rdfs:comment "Cent pièces"@fr .
cn:unit1000kWh
a qb:measureType ;
rdfs:label "100 p/st" ;
rdfs:comment "Thousand kilowatt hours"@en-GB ;
rdfs:comment "Tausend Kilowattstunden"@de ;
rdfs:comment "Mille kilowattheures"@fr .
cn:unit1000l
a qb:measureType ;
rdfs:label "1000 l" ;
rdfs:comment "Thousand litres"@en-GB ;
rdfs:comment "Tausend Liter"@de ;
rdfs:comment "Mille litres"@fr .
cn:unit1000m3
a qb:measureType ;
rdfs:label "1000 m3" ;
rdfs:comment "Thousand cubic metres"@en-GB ;
rdfs:comment "Tausend Kubikmeter"@de ;
rdfs:comment "Mille mètres cubes"@fr .
############
# Properties
# TODO: the level of hierarchy directly correlates to the code used
cn:hs4Code
a owl:DatatypeProperty ;
rdfs:subPropertyOf dcterms:identifier ;
rdfs:range xsd:string ;
rdfs:label "HS4 Code" ;
rdfs:comment "Harmonized System Code" .
cn:hs6Code
a owl:DatatypeProperty ;
rdfs:subPropertyOf dcterms:identifier ;
rdfs:range xsd:string ;
rdfs:label "HS6 Code" ;
rdfs:comment "Harmonized System Code" .
cn:hs8Code
a owl:DatatypeProperty ;
rdfs:subPropertyOf dcterms:identifier ;
rdfs:range xsd:string ;
rdfs:label "HS8 Code" ;
rdfs:comment "Harmonized System Code" .
cn:hs12Code
a owl:DatatypeProperty ;
rdfs:subPropertyOf dcterms:identifier ;
rdfs:range xsd:string ;
rdfs:label "HS12 Code" ;
rdfs:comment "Harmonized System - Product Code" .
cn:levelNumber
a owl:DatatypeProperty ;
rdfs:domain cn:level ;
rdfs:range xsd:integer ;
rdfs:label "Level" ;
rdfs:comment "Position in heirarchy, numerically." .
#####################
# Raw CSV dump (head)
#
# "Level","Code","Code","Description","Supplementary unit","Description of supplementary unit","Self-explanatory texts in English","Self-explanatory texts in French","Self-explanatory texts in German"
# "1","010011000090","I"," SECTION I - LIVE ANIMALS; ANIMAL PRODUCTS","","","LIVE ANIMALS; ANIMAL PRODUCTS","ANIMAUX VIVANTS ET PRODUITS DU RÈGNE ANIMAL","LEBENDE TIERE UND WAREN TIERISCHEN URSPRUNGS"
# "2","010021000090","01"," CHAPTER 1 - LIVE ANIMALS","","","LIVE ANIMALS","ANIMAUX VIVANTS","LEBENDE TIERE"
# "3","010100000080","0101"," Live horses, asses, mules and hinnies","","","Live horses, asses, mules and hinnies","Chevaux, ânes, mulets et bardots, vivants","Pferde, Esel, Maultiere und Maulesel, lebend"
# "4","010110000080","0101 10","- Pure-bred breeding animals","","","Pure-bred breeding horses and asses","Chevaux et ânes, reproducteurs de race pure","Zuchtpferde und Zuchtesel, reinrassig"
# "5","010110100080","0101 10 10","-- Horses","p/st","DE: Anzahl Stück; EN: Number of items; FR: Nombre de pièces","Pure-bred breeding horses","Chevaux reproducteurs de race pure","Zuchtpferde, reinrassig"
# "5","010110900080","0101 10 90","-- Other","p/st","DE: Anzahl Stück; EN: Number of items; FR: Nombre de pièces","Pure-bred breeding asses","Ânes reproducteurs de race pure","Zuchtesel, reinrassig"
@cretep
Copy link
Author

cretep commented May 14, 2011

Test with the SPARQL query:

prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix cn: <file:Data/cn-cwm.n3#>

SELECT ?cn_id ?cn_label
FROM <file:Data/cn-cwm.n3>
WHERE {
<http://example.org/catalog/sampleproduct> a ?a .
?a skos:prefLabel ?cn_label ;
   skos:notation ?cn_id .

   FILTER (lang(?cn_label)= "en-GB") .
   FILTER (datatype(?cn_id)= cn:hs12Code) .

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment