Skip to content

Instantly share code, notes, and snippets.

@nevali
Created April 15, 2014 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevali/10753613 to your computer and use it in GitHub Desktop.
Save nevali/10753613 to your computer and use it in GitHub Desktop.
liblod continued: now follows redirects properly; parses HTML to find <link rel="alternate"> elements linking to supported RDF serialisations; the test harness now has the ability to quickly locate and dump the primary topic of the most recently-received document (assuming the document is itself described in the RDF returned); and cURL calls are…
$ ./lod-util
./lod-util: a test harness for liblod
Enter a URI to resolve, or .COMMAND (type '.help' for a list of commands)
> .help
Available commands:
.help Print this message
.quit or .exit End lod-util session
.reset Discard the current context
.dump Print all of the triples in the current context
.doc Print the triples relating to the most recently-fetched
document
.primary Print the triples relating to the primary topic of the
most recently-fetched document
> http://bbc.co.uk/spooks
# subject is not present in dataset
# subject URI was <http://bbc.co.uk/spooks>
# document URI was <http://www.bbc.co.uk/programmes/b006mf4b.rdf>
> .primary
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://www.bbc.co.uk/programmes/b006mf4b#programme>
dc:title "Spooks" ;
<http://purl.org/ontology/po/genre> <http://www.bbc.co.uk/programmes/genres/drama/actionandadventure#genre> ;
<http://purl.org/ontology/po/masterbrand> <http://www.bbc.co.uk/bbcone#service> ;
<http://purl.org/ontology/po/medium_synopsis> "Tense drama series about the different challenges faced by the British Security Service as they work against the clock to safeguard the nation" ;
<http://purl.org/ontology/po/pid> "b006mf4b" ;
<http://purl.org/ontology/po/series> <http://www.bbc.co.uk/programmes/b006mf48#programme>, <http://www.bbc.co.uk/programmes/b0084lb1#programme>, <http://www.bbc.co.uk/programmes/b00fd3r8#programme>, <http://www.bbc.co.uk/programmes/b00ntg2p#programme>, <http://www.bbc.co.uk/programmes/b00ty203#programme>, <http://www.bbc.co.uk/programmes/b0153b1h#programme>, <http://www.bbc.co.uk/programmes/p008w4dv#programme>, <http://www.bbc.co.uk/programmes/p009sxfg#programme>, <http://www.bbc.co.uk/programmes/p00cfpg2#programme>, <http://www.bbc.co.uk/programmes/p00cfpg4#programme> ;
<http://purl.org/ontology/po/short_synopsis> "Tense drama series about the different challenges faced by the British Security Service" ;
a <http://purl.org/ontology/po/Brand> ;
foaf:depiction <http://www.bbc.co.uk/iplayer/images/progbrand/b006mf4b_512_288.jpg> .
# subject URI was <http://www.bbc.co.uk/programmes/b006mf4b#programme>
> http://www.bbc.co.uk/programmes/b006mf4b.rdf
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://www.bbc.co.uk/programmes/b006mf4b.rdf>
dct:created "2007-09-10T16:02:43+01:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
dct:modified "2007-11-28T18:05:51Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
rdfs:label "Description of the brand \"Spooks\"" ;
foaf:primaryTopic <http://www.bbc.co.uk/programmes/b006mf4b#programme> .
# subject URI was <http://www.bbc.co.uk/programmes/b006mf4b.rdf>
> http://purl.org/dc/terms/created
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
dct:created
dct:hasVersion <http://dublincore.org/usage/terms/history/#created-003> ;
dct:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;
dct:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;
a rdf:Property ;
rdfs:comment "Date of creation of the resource."@en ;
rdfs:isDefinedBy <http://purl.org/dc/terms/> ;
rdfs:label "Date Created"@en ;
rdfs:range rdfs:Literal ;
rdfs:subPropertyOf dc:date, dct:date .
# subject URI was <http://purl.org/dc/terms/created>
# document URI was <http://dublincore.org/2012/06/14/dcterms.ttl>
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment