New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse documents into interlinked object structures #15

Open
lanthaler opened this Issue Sep 7, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@lanthaler
Owner

lanthaler commented Sep 7, 2012

It should be possible to work directly with the data contained in a document. Some functionality that should be supported:

// load a document
$doc = Document::load('document.jsonld');

// get the default graph
$graph = $doc->getGraph();

// get all nodes in the document
$nodes = $graph->getNodes();

// retrieve a node by ID
$node = $graph->getNode('http://example.com/node1');

// get a property
$node->getProperty('http://example.com/vocab/name');

// add a new blank node to the document
$newNode = $graph->createNode();

// link the new blank node to the existing node
$node->addPropertyValue('http://example.com/vocab/link', $newNode);

// even reverse properties are supported; this returns $newNode
$node->getReverseProperty('http://example.com/vocab/link');

At a later point, it should also be possible to query for nodes or properties.

lanthaler added a commit that referenced this issue Sep 7, 2012

lanthaler added a commit that referenced this issue Feb 2, 2013

Introduce Graph as a first step towards supporting named graphs in pa…
…rsed documents

Furthermore, NodeInterface was created so that more specialized nodes can be created in custom implementations.

This addresses #15.

lanthaler added a commit that referenced this issue Feb 3, 2013

Add graph merging
This addresses #15.

lanthaler added a commit that referenced this issue Feb 4, 2013

lanthaler added a commit that referenced this issue Feb 4, 2013

lanthaler added a commit that referenced this issue Feb 6, 2013

Make interfaces more fluent
This addresses #15.
@lanthaler

This comment has been minimized.

Owner

lanthaler commented Mar 19, 2014

Merging graphs, currently doesn't work as blank nodes aren't relabeled properly. There's a bigger problem with the current implementation as nodes are generated at the graph level instead of the document level. This means that blank node graphs which are either shared between graphs or also used a graph names might get relabeled differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment