简体   繁体   中英

Represent dynamic tree with RDF

I'm trying to describe a sort of dynamically generated directed graph in RDF, where the value of each node depends on the 'summed state" of the nodes ahead of it. For example the first node can have n values. Depending on which it is, there might be m child nodes, each with one of k values. Each of these might have l child nodes, and so on and so on.

So an RDF statement can easily any 2 nodes and an edge between them. As you go through the graph though, the subject or parent node effectively describes the values of all its ancestor nodes.

Is there a way to represent such a graph without having an entity for every valid permutation of node values to represent the subject of an RDF triple?

As an example, say I want to capture some relationships in a domain in an ontology with these properties:

can_input_to  rdfs:domain material       ; rdfs:range first_process .
can_feed_into rdfs:domain first_process  ; rdfs:range second_process .
has_output    rdfs:domain second_process ; rdfs:range widget .

And some statements about instances like this:

<material_a> <can_input_to> <first_process_a>
<material_b> <can_input_to> <first_process_a>
<material_c> <can_input_to> <first_process_b>
<material_d> <can_input_to> <first_process_b>

<first_process_a> <can_feed_into> <second_process_a>   //If input is <material_a> OR <material_b>
<first_process_b> <can_feed_into> <second_process_a> //If input is <material_d> 

<second_process_a> <has_output> <widget_a>    //If input is <material_a> AND first_process is <first_process_a>
<second_process_a> <has_output> <widget_b>    //If input is <material_a> AND first_process is <first_process_b>

How could the conditions on these statements (//If input is ..) be defined or captured in the ontology?

This type of dynamic inference of child values based on parent nodes and inference rules is starting to be introduced into popular graphstores. For instance Apache Jena supports inferrence rules written in RDFS, or OWL . Pellet is an OLW 2 reasoner for Java that you could use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM