Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Apr 26, 2024
1 parent 6f27996 commit ffebc20
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# PyOntoenv

## Installation

`pip install pyontoenv`

## Usage

```python
from ontoenv import Config, OntoEnv
from rdflib import Graph

cfg = Config(["../brick"], strict=False, offline=True)

# make environment
env = OntoEnv(cfg)

g = Graph()
# get the transitive owl:imports closure into 'g'
env.get_closure("https://brickschema.org/schema/1.4-rc1/Brick", g)

brick = Graph()
brick.parse("Brick.ttl", format="turtle")
# transitively import dependencies into the 'brick' graph, using the owl:imports declarations
env.import_dependencies(brick)

# pull Brick graph out of environment
brick = env.get_graph("https://brickschema.org/schema/1.4-rc1/Brick")

# import graphs by name
env.import_graph(brick, "https://w3id.org/rec")
```

0 comments on commit ffebc20

Please sign in to comment.