Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LasseMempel committed Jul 30, 2024
1 parent f2c0549 commit ee12b03
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions poddify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import requests
from solid.auth import Auth
from solid.solid_api import SolidAPI

api = SolidAPI()
POD_ENDPOINT = "https://restaurierungsvokabular.solidweb.org/" # Pod to demostrate. Replace it with yours.
folder_name = 'wuerste'
file_name = "krakauer.ttl"

data = "<http://example.org/krakauer> <http://example.org/a> <http://example.org/wurst> ."
print(api.item_exists(POD_ENDPOINT+folder_name+"/"))
print(api.put_file(POD_ENDPOINT+folder_name+"/"+file_name, data, 'text/turtle'))
# add a new tripe to file
data = "<http://example.org/lyoner> <http://example.org/a> <http://example.org/wurst> ."
print(api.put_file(POD_ENDPOINT+folder_name+"/"+file_name, requests.get(POD_ENDPOINT+folder_name+"/"+file_name).text + data, 'text/turtle'))
data = "<http://example.org/thueringer> <http://example.org/a> <http://example.org/wurst> ."
print(api.post_item(POD_ENDPOINT+folder_name+"/", "newfile.ttl", data, 'text/turtle'))


# https://restaurierungsvokabular.solidweb.org/wuerste/krakauer.ttl

0 comments on commit ee12b03

Please sign in to comment.