README 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. The DOKK is a free database. The data is modeled as a graph, with topics represented
  2. as nodes connected by edges.
  3. Naming conventions
  4. ------------------
  5. Because the graph contains a large number of nodes, it's divided into more manageable
  6. subgraphs (one per folder).
  7. There are no restrictions on the ID values that can be used, but in order to keep
  8. things well organized the following conventions are adopted:
  9. dokk:subgraph:id
  10. | | |_____ local ID, defined within the subgraph
  11. | |______________ name of the subgraph where the node is defined
  12. |___________________ fixed prefix
  13. Using the graph
  14. ---------------
  15. Files can be parsed with any RDF library. For more advanced needs the files can
  16. be loaded in a database server (a triplestore). For this we recommend the Fuseki
  17. server.
  18. Following is a demonstration with Python and RDFLib:
  19. g = rdflib.Graph()
  20. g.parse("file-1")
  21. g.parse("file-2")
  22. g.parse("...")
  23. # Execute queries on the graph.
  24. # (example: find the names of the people that know Bob
  25. query = """
  26. SELECT ?name
  27. WHERE { ?person :knows :bob ;
  28. :name ?name . }
  29. """
  30. results = g.query(query)
  31. for r in results:
  32. print(r.name)
  33. # Or convert nodes to JSON
  34. graph_json = json.loads(g.serialize(format="json-ld"))
  35. Contacts
  36. --------
  37. If you have problems with using the database, please consider asking your questions
  38. on WOTAS (https://wotas.net).
  39. If you just want to say hi!, meet us on IRC in #peers at irc.libera.chat or
  40. https://peers.community.