Skip to content

Instantly share code, notes, and snippets.

@no-reply
Last active Aug 16, 2016
Embed
What would you like to do?
require 'rdf'
require 'rdf/spec'
statements = RDF::Spec.quads
statements.extend(RDF::Enumerable, RDF::Queryable)
statements.count # => 95
pattern = RDF::Query::Pattern.new(nil, nil, nil, graph_name: false)
statements.send(:query_pattern, pattern).count # => 95
with_graph = statements.select { |st| st.graph_name }
with_graph.count # => 20
pattern === with_graph.first # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment