View on GitHub

Rdf-aggregate-repo

An aggregate RDF::Repository supporting a subset of named graphs and zero or more named graphs mapped to the default graph.

Download this project as a .zip file Download this project as a tar.gz file

RDF::AggregateRepo

An aggregate RDF::Repository supporting a subset of named graphs and zero or more named graphs mapped to the default graph.

Gem Version Build Status

Description

Maps named graphs from one or more RDF::Queryable instances into a single object, allowing a specific set of named graphs to be seen, as well as a default graph made up from one or more named graphs. This is used to implement SPARQL Datasets.

Examples

require 'rdf'
require 'rdf/nquads'
repo = RDF::Repository.load("http://ruby-rdf.github.com/rdf/etc/doap.nq")

# Instantiate a new aggregate repo based on an existing repo
aggregate = RDF::AggregateRepo.new(repo)

# Use the default graph from the repo as the default graph of the aggregate
aggregate.add_default(false)

# Use a single named graph
aggregate.add_named(RDF::URI("http://greggkellogg.net/foaf#me"))

# Retrieve all contexts
aggreggate.contexts.to_a #=> [RDF::URI("http://greggkellogg.net/foaf#me")]

Dependencies

Mailing List

Author

Contributing

This repository uses Git Flow to mange development and release activity. All submissions must be on a feature branch based on the develop branch to ease staging and integration.

License

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