Module m_edge

Copyright 2009 Marc Worrell Date: 2009-04-09 Copyright 2009 Marc Worrell Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Behaviours: gen_model.

Authors: Marc Worrell (marc@worrell.nl).

Function Index

delete/2Delete an edge by Id.
delete/4Delete an edge by subject, object and predicate id.
delete/5
delete_multiple/4Delete multiple edges between the subject and the object.
duplicate/3Duplicate all edges from one id to another id.
get/2Get the complete edge with the id.
get_edges/2Return the full description of all edges from a subject, grouped by predicate.
get_id/4Get the edge id of a subject/pred/object combination.
get_triple/2Get the edge as a triple {subject_id, predicate, object_id}.
insert/4
insert/5
m_find_value/3Fetch all object/edge ids for a subject/predicate.
m_to_list/2Transform a m_config value to a list, used for template loops.
m_value/2Transform a model value so that it can be formatted or piped through filters.
object/4Return the Nth object with a certain predicate of a subject.
object_edge_ids/3Return all object ids with the edge id for a predicate/subject_id.
object_predicate_ids/2Return the list of predicate ids in use by edges to objects from the id.
object_predicates/2Return the list of predicates in use by edges to objects from the id.
objects/2Return all object ids of the resource.
objects/3Return all object ids of an id with a certain predicate.
replace/4Replace the objects with the new list.
set_sequence/4Set edges order so that the specified object ids are in given order.
subject/4Return the Nth subject with a certain predicate of an object.
subject_edge_ids/3Return all subject ids with the edge id for a predicate/object_id.
subject_predicate_ids/2Return the list of predicates is use by edges from subjects to the id.
subject_predicates/2Return the list of predicates is use by edges from subjects to the id.
subjects/2Return all subject ids of the resource.
subjects/3Return all subject ids of an object id with a certain predicate.
update_nth/5Update the nth edge of a subject.
update_sequence/4Reorder the edges so that the mentioned ids are in front, in the listed order.
update_sequence_edge_ids/4Update the sequence for the given edge ids.

Function Details

delete/2

delete(Id, Context) -> any()

Delete an edge by Id

delete/4

delete(SubjectId, Pred, ObjectId, Context) -> any()

Delete an edge by subject, object and predicate id

delete/5

delete(SubjectId, Pred, ObjectId, Options, Context) -> any()

delete_multiple/4

delete_multiple(SubjectId, Preds, ObjectId, Context) -> any()

Delete multiple edges between the subject and the object

duplicate/3

duplicate(Id, ToId, Context) -> any()

Duplicate all edges from one id to another id. Skip all edges that give ACL errors.

get/2

get(Id, Context) -> any()

Get the complete edge with the id

get_edges/2

get_edges(SubjectId, Context) -> any()

Return the full description of all edges from a subject, grouped by predicate

get_id/4

get_id(SubjectId, PredId, ObjectId, Context) -> any()

Get the edge id of a subject/pred/object combination

get_triple/2

get_triple(Id, Context) -> any()

Get the edge as a triple {subject_id, predicate, object_id}

insert/4

insert(Subject, Pred, Object, Context) -> any()

insert/5

insert(SubjectId, PredId, ObjectId, Opts, Context) -> any()

m_find_value/3

m_find_value(Key, M::Source, Context) -> term()

Fetch all object/edge ids for a subject/predicate

m_to_list/2

m_to_list(M::Source, Context) -> List

Transform a m_config value to a list, used for template loops

m_value/2

m_value(M::Source, Context) -> term()

Transform a model value so that it can be formatted or piped through filters

object/4

object(Id, Pred, N, Context) -> any()

Return the Nth object with a certain predicate of a subject.

object_edge_ids/3

object_edge_ids(Id, Predicate, Context) -> list()

Return all object ids with the edge id for a predicate/subject_id

object_predicate_ids/2

object_predicate_ids(Id, Context) -> List

Return the list of predicate ids in use by edges to objects from the id

object_predicates/2

object_predicates(Id, Context) -> List

Return the list of predicates in use by edges to objects from the id

objects/2

objects(Id, Context) -> list()

Return all object ids of the resource

objects/3

objects(Id, Pred, Context) -> List

Return all object ids of an id with a certain predicate. The order of the ids is deterministic.

replace/4

replace(SubjectId, PredId, NewObjects, Context) -> any()

Replace the objects with the new list

set_sequence/4

set_sequence(Id, Pred::Predicate, ObjectIds, Context) -> ok | {error, Reason}

Set edges order so that the specified object ids are in given order. Any extra edges not specified will be deleted, and any missing edges will be inserted.

subject/4

subject(Id, Pred, N, Context) -> any()

Return the Nth subject with a certain predicate of an object.

subject_edge_ids/3

subject_edge_ids(Id, Predicate, Context) -> list()

Return all subject ids with the edge id for a predicate/object_id

subject_predicate_ids/2

subject_predicate_ids(Id, Context) -> List

Return the list of predicates is use by edges from subjects to the id

subject_predicates/2

subject_predicates(Id, Context) -> List

Return the list of predicates is use by edges from subjects to the id

subjects/2

subjects(Id, Context) -> list()

Return all subject ids of the resource

subjects/3

subjects(Id, Pred, Context) -> List

Return all subject ids of an object id with a certain predicate. The order of the ids is deterministic.

update_nth/5

update_nth(SubjectId::int(), Predicate, Nth::int(), ObjectId, Context) -> {ok, EdgeId} | {error, Reason}

Update the nth edge of a subject. Set a new object, keep the predicate. When there are not enough edges then an error is returned. The first edge is nr 1.

update_sequence/4

update_sequence(Id, Pred::Predicate, ObjectIds, Context) -> ok | {error, Reason}

Reorder the edges so that the mentioned ids are in front, in the listed order.

update_sequence_edge_ids/4

update_sequence_edge_ids(Id, Pred::Predicate, EdgeIds, Context) -> ok | {error, Reason}

Update the sequence for the given edge ids. Optionally rename the predicate on the edge.


Generated by EDoc, Oct 31 2014, 17:54:26.