Skip to content

RDF Collection Flattening Graph

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
license.txt
Notifications You must be signed in to change notification settings

hsolbrig/CFGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CFGraph - RDF Collections flattener for rdflib

Pyversions PyPi

Revision History

  • 0.1.0 - Initial drop
  • 0.2.0 - Functionality overhaul
  • 0.2.1 - Fixes issue #1

An implementation of a rdflibGraph that reads well-formed RDF collections as lists.

Requirements

  • Python 3.6 -- this module uses the new typing annotations
  • rdflib -- a Python library for working with RDF

Use

See Jupyter notebook

Notes

This is a read-only interface. It does not convert list style representations into collections.

This module assumes that collections are "well formed", as determined by common convention. (Why the RDF WG did not put a stake in the gound on this remains a mystery). By "well formed" we mean:

  • Empty list: :s :p rdf:nil.
  • Single element: :s :p _:b1 . _:b1 rdf:first :o; rdf:rest rdf:nil
  • Every list (_:n) in a list will have exactly two entries, _:n rdf:first . and _:n rdf:rest [_:n2 or rdf:nil]

In addition, we impose the restriction:

  • The subject of rdf:first or rdf:rest is always a blank node.

The output for RDF Collections that do not conform to the above rules is not predictable.

About

RDF Collection Flattening Graph

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
license.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages