# \[Solved\] Map RDF to k-partite graph

**URL:** <https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010>\
**Category:** Node Development\
**Created:** [April 8, 2013, 12:06pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010 "2013-04-08T12:06:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![david9ppo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@david9ppo](https://forum.knime.com/u/david9ppo)\
**Post date:** [April 8, 2013, 12:06pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/1 "2013-04-08T12:06:25Z")

</div>

Hi,

I'm working with Knime Labs for my final project. I've done some nodes to work with RDF format and my next goal is try to convert RDF model to a graph for using Network nodes with it.

I know that Knime uses a k-partite graph representation and I know this kind of internal representation is a good idea for mapping RDF model. I need a partition for nodes and other partition for edges (2-partite graph).

But I need some sample of use, e.g. how to create a small graph with some nodes and edges.

I hope good news for me!

Thanks to all, and I'm sorry for my English (I'm from Spain)

---

<div class="post-metadata">

**Author:** ![gabriel](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gabriel/32/61386_2.png) [@gabriel](https://forum.knime.com/u/gabriel)\
**Post date:** [April 8, 2013, 3:21pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/2 "2013-04-08T15:21:15Z")

</div>

I guess you are looking for some examples for the Network Mining extensions. Please check out the [Public Example Server](https://forum.knime.com/example-workflows).

---

<div class="post-metadata">

**Author:** ![tobias.koetter](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tobias.koetter/32/56844_2.png) [@tobias.koetter](https://forum.knime.com/u/tobias.koetter)\
**Post date:** [April 8, 2013, 3:59pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/3 "2013-04-08T15:59:36Z")

</div>

Hi,

&nbsp;a good starting point would be the [social network example](https://forum.knime.com/book/network-examples/socialNetworkAnalysis) which is available on the example server and described in the [Network Mining](https://forum.knime.com/network-mining) section of the KNIME labs. You might also want to take a look at the [DrugBank example](https://forum.knime.com/book/network-examples/drugBank) which is also available on the example server. This example workflow use partitions to distinguish between different node types such as drugs, proteins, terms, etc. Have a look at the _Advanced Options_ tab of the _Object Inserter_ nodes to see how to assign partitions (e.g. types) to nodes and edges.

Bye,

Tobias

---

<div class="post-metadata">

**Author:** ![frank](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/f/3d9bf3/32.png) [@frank](https://forum.knime.com/u/frank)\
**Post date:** [April 8, 2013, 9:22pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/4 "2013-04-08T21:22:01Z")

</div>

Hi,

&nbsp;

I am curious about your nodes working with RDF. Can you explain some details about your work with KNIME und RDF?

&nbsp;

Frank

---

<div class="post-metadata">

**Author:** ![david9ppo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@david9ppo](https://forum.knime.com/u/david9ppo)\
**Post date:** [April 8, 2013, 10:33pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/5 "2013-04-08T22:33:21Z")

</div>

Basically, I've nodes to read RDF files (from file or URL), a node for querying the RDF model (ask, construct, describe and select queries) and a node for converting RDF to XML in order to take advantage of existing XML nodes.

This is all so far!

David.

---

<div class="post-metadata">

**Author:** ![david9ppo](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@david9ppo](https://forum.knime.com/u/david9ppo)\
**Post date:** [April 8, 2013, 10:50pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/6 "2013-04-08T22:50:35Z")

</div>

Hi Tobias,

first of all, thanks for your attention! I know that I can see these samples, but I was referring to help with code.

I have one node that returns a RDF model (how XMLReader node returns a XML document) using BufferedDataTable[].

Well, now I need to code one node that:

1. _It must obtain the RDF model from the input (BufferedDataTable[])_
2. _Convert RDF statements (subjects, properties & objects) into Graph (nodes,edges)._
3. _It must return the graph representation (PortObject[])._

I don´t know if I can using some implemented Class in order to make the job easier.

Thank you very much! ;)

D

---

<div class="post-metadata">

**Author:** ![tobias.koetter](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tobias.koetter/32/56844_2.png) [@tobias.koetter](https://forum.knime.com/u/tobias.koetter)\
**Post date:** [April 9, 2013, 9:09pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/7 "2013-04-09T21:09:58Z")

</div>

Hi,

I would suggest that your nodes return a standard KNIME data table that contains three columns (subject, predicate and object). Once you have such a table you can use the object inserter to create a network out of the rdf data table. This would make it much easier for you since you do not need to learn the network specific classes. In addition you can use all the pre-processing nodes in KNIME to first clean up your data (e.g. grouping, filtering, etc.) prior creating the network. This way your plugin wouldn’t be dependent on the network plugins (org.knime.network.core and org.knime.network.base) and could such be easier used by other peoples and I guess there is a lot of interest in such nodes. By the way, do you plan to make these nodes public available? If that is the case and you are interested in we would be happy to host as part of the [community contributions](https://forum.knime.com/community).

However if you really want to implement a node that outputs a network you might want to have a look at the _org.knime.network.node.inserter.object.ObjectInsertNodeModel_ and the _org.knime.network.node.io.matrix.reader.Matrix2NetworkNodeModel_. They both belong to the _org.knime.network.base_ plugin and create a network from a data table.

Unfortunately we do not have a developer introduction for the network plugin yet. So if you have any further questions please do not hesitate to [contact](https://forum.knime.com/user/18/contact)me directly.

Bye,

Tobias

---

<div class="post-metadata">

**Author:** ![frank](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/f/3d9bf3/32.png) [@frank](https://forum.knime.com/u/frank)\
**Post date:** [April 10, 2013, 8:12pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/8 "2013-04-10T20:12:23Z")

</div>

Hi David

&nbsp;

Sounds interesting for us. We have some taxonomy data that can be exported in RDF format and that should be mined in KNIME. Maybe we can learn from you how to work with RDF in KNIME.

&nbsp;

Frank&nbsp;

---

<div class="post-metadata">

**Author:** ![29axe](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/2/ee7513/32.png) [@29axe](https://forum.knime.com/u/29axe)\
**Post date:** [May 2, 2014, 9:03am UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/9 "2014-05-02T09:03:15Z")

</div>

Hi David,

I'm also interested in reading RDF files. What kind of nodes&nbsp;did you use to read these files? Did you find an existing one or did you build your own?&nbsp;

Thanks

Dan

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:17pm UTC](https://forum.knime.com/t/solved-map-rdf-to-k-partite-graph/2010/10 "2023-06-23T20:17:14Z")

</div>


