Open DiellzaElshani opened 1 year ago
Actually even simple triples should readable and convertable to Custom BHoM objects.
For example, from something like this,
<http://individuals.org/666b52ed-2e08-4c0a-982e-baad32160bfd> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#NamedIndividual> .
<http://individuals.org/e574f17d-c8fa-4cd4-8387-7480d3b6cda5> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#NamedIndividual> .
<http://individuals.org/791c4755-7867-4ea6-8082-8dc5951d42e8> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#NamedIndividual> .
We should know that:
1) The ABox URI is: http://individuals.org; 2) There are 3 instances with one property GUID. The GUIDs of these instances are: 666b52ed-2e08-4c0a-982e-baad32160bfd e574f17d-c8fa-4cd4-8387-7480d3b6cda5 9a36b397-cc9d-46df-8799-3f67da45843a
In grasshopper should look like:
I tried different functions using System.Text.RegularExpressions, and I got some results that look very similar to the one we generate from gh. This result almost work to convert back to BHoM objects from a graph exported from graph DB.
Finally I understood that for us to be able to read a graph exported form graph DB we only need to fix two things:
Fix the individuals representation.
1) For the headings, the prefixed on top we need to:
a) Remove the prefix without abbreviation; the one graphDB exported in the example I sent is: @prefix : <file:/snippet/generated/www.bhom.org/> .
b) Add Tbox Uri twice:
Here is also my gh script where I did the tests, it includes some c# components that fix the (1) problem with headings.
GH tests to fix the string.zip (I assume this would solve the problem when we query the whole graph, but I guess querying just some parts will also require similar approach)
For now, we proceed with manual download of the construct query result. To do:
Future step:
Description:
A graph generated from BHoM can be queried and manipulated in GraphDB. However, when a graph generated from BHoM is manipulated in GraphDB it can not be read from "fromTTL" component.
A graph exported from graphDB is saved below. ResultFrom GraphDB query.txt
Reading such graphs would allow having in Grasshopper BHoM objects new properties or links that were generated in Graph environment,.