Skip to content

Instantly share code, notes, and snippets.

@Mec-iS
Created September 12, 2014 09:59
Show Gist options
  • Save Mec-iS/ab76b536417e12b2918f to your computer and use it in GitHub Desktop.
Save Mec-iS/ab76b536417e12b2918f to your computer and use it in GitHub Desktop.
example for an RDF-XML representation of the NASA-STI categories
<?xml version="1.0"?>
<!-- Definition of Category Astronomy -->
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
<skos:Concept rdf:about="http://mydomain.com/astronomy">
<skos:definition>Includes observations of celestial bodies; astronomical instruments and techniques; radio, gamma-ray, x-ray, ultraviolet, and infrared astronomy; and astrometry.</skos:definition>
<skos:prefLabel xml:lang="en">Astronomy</skos:prefLabel>
<skos:scopeNote>Exhaustive Interest : Except for astrophysics, all facets of astronomy including radio and gamma-ray astronomy, observations of celestial bodies, their structure, motions, and locations.</skos:scopeNote>
<skos:broader rdf:resource="http://mydomain.com/space+sciences#"/>
<skos:related rdf:resource="http://dbpedia.org/page/Astronomy"/>
</skos:Concept>
</rdf:RDF>
<?xml version="1.0"?>
<!-- Definition of Category infrared astronomy -->
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
<skos:Concept rdf:about="http://mydomain.com/infrared+astronomy">
<skos:definition></skos:definition>
<skos:prefLabel xml:lang="en">infrared astronomy</skos:prefLabel>
<skos:broader rdf:resource="http://mydomain.com/astronomy#"/>
<skos:related rdf:resource="http://mydomain.com/space_sciences#"/>
<skos:related rdf:resource="http://dbpedia.org/page/Infrared"/>
</skos:Concept>
</rdf:RDF>
<?xml version="1.0"?>
<!-- Definition of Keyword infrared telescopes -->
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
<skos:Concept rdf:about="http://mydomain.com/infrared+telescopes">
<skos:definition></skos:definition>
<skos:prefLabel xml:lang="en">infrared telescopes</skos:prefLabel>
<skos:broader rdf:resource="http://mydomain.com/astronomy#"/>
<skos:related rdf:resource="http://mydomain.com/space_sciences#"/>
<skos:related rdf:resource="http://dbpedia.org/page/Infrared"/>
</skos:Concept>
</rdf:RDF>
Three examples of RDF-SKOS definitions: a keyword, a category and a division taken from NASA-STI (http://www.sti.nasa.gov/sscg/main.html)
Common prefixes:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
File 1:
<!-- defining a keyword as a Concept, at URI = http://mydomain.com/infrared+astronomy# -->
<http://mydomain.com/infrared+astronomy> rdf:type skos:Concept ;
skos:prefLabel "infrared astronomy"@en ;
skos:inScheme <http://mydomain.com/astronomy> ;
skos:related <http://dbpedia.org/page/Infrared> .
File 2:
<!-- defining a subject as a ConceptScheme, at URI = http://mydomain.com/astronomy# -->
<http://mydomain.com/astronomy> rdf:type skos:ConceptScheme ;
skos:prefLabel "Astronomy"@en ;
skos:definition "definition of Astronomy category in NASA-STI"@en ;
skos:member <http://mydomain.com/infrared+astronomy> , <http://mydomain.com/extrasolar+planets> , <etc> .
File 3:
<!-- defining a division as a Collection, at URI = http://mydomain.com/space_sciences# -->
<http://mydomain.com/space_sciences> rdf:type skos:Collection ;
skos:prefLabel "Space Sciences"@en ;
skos:definition "definition of Space Science division in NASA-STI"@en ;
skos:member <http://mydomain.com/astronomy> , <http://mydomain.com/astrophysics> , <etc> .
XML-SKOS EXAMPLE for a WEBPAGE
<!-- Namespace definitions -->
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
<!-- rdf description (using skos namespace) -->
<skos:Concept rdf:about="http://www.nasa.gov/mission_pages/nustar/news/nustar20130829.html">
<skos:definition>a webpage about nustar and x-ray</skos:definition>
<skos:prefLabel xml:lang="en">NuSTAR Delivers the X-Ray Goods</skos:prefLabel> <!-- title -->
<skos:altLabel xml:lang="en">NASA's Nuclear Spectroscopic Telescope Array, or NuSTAR, is giving the wider astronomical community a first look at its unique X-ray images of the ...</skos:altLabel>
<skos:broader rdf:resource="http://mydomain.com/NASA_mission"/>
<skos:related rdf:resource="http://mydomain.com/x-ray+astronomy#"/>
<skos:related rdf:resource="http://mydomain.com/space_sciences#"/>
<skos:related rdf:resource="http://mydomain.com/astronomy#"/>
</skos:Concept>
</rdf:RDF>
EXAMPLE JSON-LD (http://json-ld.org/playground/index.html)
{
"@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"skos": "http://www.w3.org/2004/02/skos/core#"
},
"rdf:about":"http://www.nasa.gov/mission_pages/nustar/news/nustar20130829.html",
"skos:prefLabel": "NuSTAR Delivers the X-Ray Goods",
"skos:related": "http://mydomain.com/x-ray+astronomy#",
"skos:related": "http://mydomain.com/astronomy#",
"skos:related": "http://mydomain.com/space+sciences#"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment