Skip to content

Overrides RDF::Mutable#load to use HTTP cache control semantics against existing contexts.

License

Notifications You must be signed in to change notification settings

gkellogg/rdf-load-cached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDF::LoadCached

HTTP Cache semantics for loaded graphs for RDF.rb.

Description

This plugin modifies the behavior of RDF::Mutable#load to maintain metadata about loaded graphs to enable HTTP content caching.

Details are stored using the Void and [SPARQL Service Description][SSD] vocabularies.

Mutable objects (such as RDF::Resource) including this module will have Dataset information asserted similar to the following:

@prefix sd: http://www.w3.org/ns/sparql-service-description# . @prefix void: http://rdfs.org/ns/void# . @prefix cache: http://rdf.rubygems.org/cache#

:DataSet a sd:Dataset; sd:defaultGraph [ a sd:Graph, void:Dataset; dc:source ; # Used as source for the sd:Graph resource as well as the graph origin URI. dc:date "1994-11-15T08:12:31Z"; # HTTP Date field dc:modified "1994-11-15T12:45:65Z"; # HTTP Last-Modified cache:cachable true; # From public/private/no-cache/no-store cache:age "3600"^^%xsd:integer; # HTTP Age: 3600 cache:maxAge "3600"^^%xsd:integer; # HTTP Cache-Control: max-age="3600" cache:etag "737060cd8c284d8af7ad3082f209582d"^^xsd:string; # HTTP ETag cache:expires "1994-12-01T16:00:00Z"^^xsd:dateTime; # HTTP Expires ]; sd:namedGraph [ a sd:Graph, void:Dataset; dc:source ; cache:etag "737060cd8c284d8af7ad3082f209582d"^^xsd:string; sd:name ; # Name indicates context of dataset ] .

sd:defaultGraph and sd:namedGraph will use the filename as the object, and can be used to update the dataset as appropriate.

A service using this object as a SPARQL dataset may supplement information stored as part of the graph descriptions with other service information such as sd:uri describing an sd:Service, and other appropriate properties.

Within an RDF::Queryable instance, triples from sd:defaultGraph datasets are merged together. Triples from sd:namedGraph datasets are kept within distinct contexts (i.e., the sd:name is used as a :context entry for each RDF::Statement).

Documentation

  • {RDF::LoadCached}

Dependencies

  • Ruby (>= 1.8.7) or (>= 1.8.1 with [Backports][])
  • RDF.rb (>= 0.3.1)

Mailing List

Author

Contributors

Refer to the accompanying {file:CREDITS} file.

Contributing

  • Do your best to adhere to the existing coding conventions and idioms.
  • Don't use hard tabs, and don't leave trailing whitespace on any line.
  • Do document every method you add using YARD annotations. Read the tutorial or just look at the existing code for examples.
  • Don't touch the .gemspec, VERSION or AUTHORS files. If you need to change them, do so on your private branch only.
  • Do feel free to add yourself to the CREDITS file and the corresponding list in the the README. Alphabetical order applies.
  • Do note that in order for us to merge any non-trivial changes (as a rule of thumb, additions larger than about 15 lines of code), we need an explicit public domain dedication on record from you.

License

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying {file:UNLICENSE} file.

Portions of tests are derived from W3C DAWG tests and have other licensing terms.

About

Overrides RDF::Mutable#load to use HTTP cache control semantics against existing contexts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published