<commit_before>SPARQL Algebra for RDF.rb
=========================

This is an in-the-works (currently pre-alpha) [Ruby][] implementation of the
[SPARQL][] algebra for [RDF.rb][].

* <http://github.com/bendiken/sparql-algebra>

Features
--------

* Implements all of [SPARQL 1.0][]'s `FILTER` operators and functions.
* Implements `FILTER` expression evaluation on `RDF::Query` solution sequences.
* Implements `FILTER` expression optimizations such as constant folding,
  strength reduction, and memoization.
* Compatible with Ruby 1.8.7+, Ruby 1.9.x, and JRuby 1.4/1.5.
* 100% free and unencumbered [public domain](http://unlicense.org/) software.

Examples
--------

    require 'sparql/algebra'
    
    include SPARQL::Algebra

### Constructing operator expressions manually

    Operator(:isBlank).new(RDF::Node(:foobar))
    Operator(:isIRI).new(RDF::URI('http://rdf.rubyforge.org/'))
    Operator(:isLiteral).new(RDF::Literal(3.1415))
    Operator(:str).new(Operator(:datatype).new(RDF::Literal(3.1415)))

### Constructing operator expressions using SSE forms

    Expression[:isBlank, RDF::Node(:foobar)]
    Expression[:isIRI, RDF::URI('http://rdf.rubyforge.org/')]
    Expression[:isLiteral, RDF::Literal(3.1415)]<commit_msg>Readme update.<commit_after>SPARQL Algebra for RDF.rb
=========================

This is an in-the-works (currently pre-alpha) [Ruby][] implementation of the
[SPARQL][] algebra for [RDF.rb][].

* <http://github.com/gkellogg/sparql-algebra>

Features
--------

* Implements all [SPARQL 1.0][] algebra operators generating `RDF::Query` compatible
  solution sequences.
* Implements `FILTER` expression optimizations such as constant folding,
  strength reduction, and memoization.
* Compatible with Ruby 1.8.7+, Ruby 1.9.x, and JRuby 1.4/1.5.
* 100% free and unencumbered [public domain](http://unlicense.org/) software.

Examples
--------

    require 'sparql/algebra'
    
    include SPARQL::Algebra

### Constructing operator expressions manually

    Operator(:isBlank).new(RDF::Node(:foobar))
    Operator(:isIRI).new(RDF::URI('http://rdf.rubyforge.org/'))
    Operator(:isLiteral).new(RDF::Literal(3.1415))
    Operator(:str).new(Operator(:datatype).new(RDF::Literal(3.1415)))

### Constructing operator expressions using SSE forms

    Expression[:isBlank, RDF::Node(:foobar)]
    Expression[:isIRI, RDF::URI('http://rdf.rubyforge.org/')]
    Expression[:isLiteral, RDF::Literal(3.1415)]
{'fraction_non_alphanumeric': 0.18196788801976121, 'fraction_numerical': 0.02387813915191437, 'mean_word_length': 4.638051044083527, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3033218', 'n_tokens_mistral': 860, 'n_tokens_neox': 777, 'n_words': 174}