A scripting language for creating RDF graphs.
RDFScript requires Python 3.x.
Python package dependencies are listed in setup.py
.
git clone https://github.com/lgrozinger/rdfscript.git
cd rdfscript
(This method requires setuptools, which can be installed from your package manager on most *nix systems, and is probably called python3-setuptools or similar)
3a. As a non-root user. python setup.py install --user
(This method requires pip)
3b.python -m pip install rdflib lxml requests ply pathlib pysbolgraph
Running the example in examples/templates.rdfsh
python run.py -s rdfxml examples/templates.rdfsh -o <output-file>
Run the REPL
python run.py -s rdfxml -o <output-file>
Display command line options, including available serialisations.
python run.py -h
The example files in examples/
are commented with some explaination of the language.
git clone https://github.com/lgrozinger/ShortBOL2
python run.py -s sbolxml <YOUR_SHORTBOL2_DIR>/example.rdfsh -o <output-file>
output-file
is an SBOL file.dev
is for the latest code that should work.
Extensions provide a way to execute Python code to do additional, more complex processing of the RDF triples generated by expanding templates.
Extensions intended as built-ins should be added to the extensions
package. 'Third party' extensions can also be added at the command line, as long as they are in the Python PATH.
For an example of an extension
, see AtLeastOne
in https://github.com/lgrozinger/rdfscript/blob/dev/extensions/cardinality.py
Please branch off of dev
for feature development, or work directly on dev
for bug-fixes.
A test suite using the Python3 unittest
package is under the test/
directory.
Run the tests from the project root using python -m unittest
The concept, design and implementation draws heavily on work from Matt Pocock on ShortBOL. Many thanks to Matt