Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nbittich/tortank

Turtle parser
https://github.com/nbittich/tortank

rdf rdflib turtle

Last synced: 2 months ago
JSON representation

Turtle parser

Awesome Lists containing this project

README

        

# turtle parser

transforms a turtle string to a TurtleDoc

## Work in progress

- Covers roughly the turtle spec https://www.w3.org/TR/turtle/
- Collections, Blank nodes, predicateObjectlist,etc
- Comments are filtered

## Todo

- error handling
- iri as described in the spec
- cleanup
- Jena like api

### Example

#### Input

```turtle
@prefix foaf: .
[ foaf:name "Alice" ] foaf:knows [
foaf:name "Bob" ;
foaf:lastName "George", "Joshua" ;
foaf:knows [
foaf:name "Eve" ] ;
foaf:mbox ] .

```

#### Output

```turtle
"Alice"^^.
"Bob"^^.
"George"^^.
"Joshua"^^.
"Eve"^^.
.
.

```

#### Input

```turtle
@prefix : .
:a :b ( "apple" "banana" ) .
```

#### Output

```turtle
"apple"^^.
"banana"^^.
.
.
.

```