Graph class

Constructors

Graph()

Properties

contexts Map<String, String>
The set to store prefixed namespaces
getter/setter pair
ctx Map<String, URIRef>
The set to store all prefixed namespaces.
getter/setter pair
graphs Map<URIRef, Set<Triple>>
The set to store different groups of triples
getter/setter pair
groups Map<URIRef, Map<URIRef, Set>>
The set to store different groups of triples in the form of {sub1: {pre1: {obj1}, pre2, {obj2, obj2_1}}, sub2: {pre3: {obj3, obj3_1}, ...}, ...}
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
parser → Parser
The grammar parser to extract file content to a list.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializedString String
The string for storing serialized string after parsing.
getter/setter pair
triples Set
The set to store all triples in the graph.
getter/setter pair

Methods

add(Triple triple) → void
Adds triple to the set, also update the graph to include the triple.
addNamedIndividual(URIRef sub) bool
Adds named individual to the graph:
addNamedIndividualToGroups(dynamic s) bool
Adds named individual to graph:
addObjectProperty(URIRef obj, URIRef relation, URIRef prop) → void
Adds object property to link two triple subjects together.
addPrefixToCtx(String prefixName, URIRef uriRef) → void
Adds a prefix to context using its string forms
addPropertyToGroups(dynamic s, dynamic uriRefBase) bool
Adds property to graph:
addTripleToGroups(dynamic s, dynamic p, dynamic o) → void
Adds a triple to group using its string forms.
bind(String name, Namespace ns) → void
Binds a namespace to a prefix for better readability when serializing.
item(String s) → dynamic
Converts a string to its corresponding URIRef, or Literal form.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
objects(URIRef sub, URIRef pre) Set
Finds all objects which have a certain subject and predicate.
parse(String filePath) → dynamic
Parses file and update graph accordingly.
parseText(String text) → dynamic
Parses whole text and update graph accordingly.
parseTurtle(String fileContent) → void
Parses a valid turtle file read into a string fileContent.
serialize({String format = 'ttl', String? dest, String? abbr}) → void
Serializes the graph to certain format and export to file.
subjects(URIRef pre, dynamic obj) Set<URIRef>
Finds all subjects which have a certain predicate and object.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited