Last active
August 16, 2016 18:32
-
-
Save no-reply/304849a58688a2ff4ac66c0b47455121 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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