<commit_before>rdfmagic
========

Introduction
------------

I had been doing a lot of work using `librdf`_
and wanted a way to easily browse tablular results of 
queries.

So I wrote this.


Prefixes
--------

There's a few magics to manipulate a dictionary of default prefixes
that will be added to sparql queries.

%lsns
  show the list of current prefix to url mappings

%addns prefix url
  defines prefix for the specified url. this is equivalent
  to having done ``PREFIX prefix: <url>`` at the start of your sparql query.
  (Other than the prefixes are also used to shorten output.

%delns prefix
  removes a prefix from the dictionary of default prefixes

%%sparql 
  issues a sparql query. (can takes a number of arguments)
  
    -m --model <arg>
        specify model name to run query against
    -o --output <arg>
        specify variable to store result of query in
    -s --source <arg>
        add source to model
    -c --count
        display how many triples were returned

%load_source [source]*
  load a list of source into a model

    -m --model <arg>
        model name to store triples in
    source
        list of locations to load triples from
    
%save_model filename
  serialize model in filename
  
  -m --model
      model to store.
  -f --format
      format to serialize model in (turtle, rdf/xml, etc)
  
  
.. _librdf: http://librdf.org/<commit_msg>changes to update README documentation.<commit_after>rdfmagic
========

Introduction
------------

I had been doing a lot of work using `librdf`_
and wanted a way to easily browse tablular results of 
queries.

So I wrote this.


Prefixes
--------

There's a few magics to manipulate a dictionary of default prefixes
that will be added to sparql queries.

%lsns
  show the list of current prefix to url mappings

%addns prefix url
  defines prefix for the specified url. this is equivalent
  to having done ``PREFIX prefix: <url>`` at the start of your sparql query.
  (Other than the prefixes are also used to shorten output.

%delns prefix
  removes a prefix from the dictionary of default prefixes

%%sparql 
  issues a sparql query. Providing at least a model or a source is required.
  
    -m --model <arg>
        specify model variable to run query against. If no model is set,
        it will use a new temporary memory model
    -s --source <arg>
        add source url to pre-load data from.
    -o --output <arg>
        specify variable to store result of query in
    -c --count
        display how many triples were returned

%load_source [source]*
  load a list of sources into a model

    -m --model <arg>
        model name to store triples in
    source
        list of locations to load triples from
    
%save_model filename
  serialize model in filename
  
  -m --model
      model to store.
  -f --format
      format to serialize model in (turtle, rdf/xml, etc)
  
  
.. _librdf: http://librdf.org/

{'fraction_non_alphanumeric': 0.07285223367697595, 'fraction_numerical': 0.0, 'mean_word_length': 2.5284848484848483, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7404216', 'n_tokens_mistral': 854, 'n_tokens_neox': 837, 'n_words': 421}