anusii / rdflib

A pure Dart package for working with RDF (resource description framework).
https://pub.dev/packages/rdflib
GNU General Public License v3.0
15 stars 3 forks source link

Review `rdflib` package #32

Open gjwgit opened 10 months ago

gjwgit commented 10 months ago

Description

Review the current API and propose new API that will support common RDF operations that we have used throughout our flutter apps.

Why

So that we can have a simplified interface to make it really easy for the flutter app developer to process RDF data.

jesscmoore commented 10 months ago
zheyxu commented 10 months ago

what are we using in the Indi and Podnotes apps?

INDI app:

void parseTurtle(String fileContent) Parses a valid turtle file read into a string [fileContent]. Updates [Graph.ctx], [Graph.groups] and [Graph.triples] in the process. bool inNamespace(Namespace ns) Checks if a full URIRef contains the namespace. Set objects(URIRef sub, URIRef pre) Finds all objects which have a certain subject and predicate. URIRef withAttr(String attr) This is used to further shorten the namespace binding.

Clinic app:

void parseTurtle(String fileContent) Parses a valid turtle file read into a string [fileContent]. Updates [Graph.ctx], [Graph.groups] and [Graph.triples] in the process. bool inNamespace(Namespace ns) Checks if a full URIRef contains the namespace. Set objects(URIRef sub, URIRef pre) Finds all objects which have a certain subject and predicate. URIRef withAttr(String attr) This is used to further shorten the namespace binding.

Form app:

bool addNamedIndividualToGroups(dynamic s) Adds named individual to graph: rdf:type owl:NamedIndividual. void addTripleToGroups(dynamic s, dynamic p, dynamic o) Adds a triple to group using its string forms. void addObjectProperty(URIRef obj, URIRef relation, URIRef prop) Adds object property to link two triple subjects together. void bind(String name, Namespace ns) Binds a namespace to a prefix for better readability when serializing. void serialize({String format = 'ttl', String? dest, String? abbr}) Serializes the graph to certain format and export to file.

Podnotes app:

void parseTurtle(String fileContent) Parses a valid turtle file read into a string [fileContent]. Updates [Graph.ctx], [Graph.groups] and [Graph.triples] in the process.