BHoM / RDF_Prototypes

Research project of the Cluster of Excellence "Integrative Computational Design and Construction for Architecture" (IntCDC) https://www.intcdc.uni-stuttgart.de/ **Project Name**: Knowledge Representation for Multi-Disciplinary Co-Design of Buildings. https://www.intcdc.uni-stuttgart.de/research/research-projects/rp-20/
GNU Lesser General Public License v3.0
8 stars 4 forks source link

Publishing information as Linked Data on the Web. #59

Open DiellzaElshani opened 1 year ago

DiellzaElshani commented 1 year ago

Description:

The goal of Linked Data is to enable people to share structured data on the Web as easily as they can share documents today. Alongside generating unique URIs, we also need to provide a mechanism that publishes our data in web, (to that URI) in RDF format.

http://wbsg.informatik.uni-mannheim.de/bizer/HowtoPublishLinkedData.htm

(I will add more info in the future). @danielhz please give suggestions if you have.

danielhz commented 1 year ago

So far, we have a function that converts C# objects of BHoM types to a serialized RDF graph. I guess that the function that does this conversion is the function ToTTLGraph below.

https://github.com/BHoM/RDF_Prototypes/blob/f0c3a4f5a6323765458a95ba21b1ebfc49230c6a/RDF_Engine/Convert/TTL/ToTTLGraph.cs#L47-L48

In general, a program can read RDF graphs, and write RDF graphs using the function ToTTLGraph above. To publish RDF graphs on the web, the serialized output of function ToTTLGraph has to be aware of the URL where the data will be published in order to allow that every resource (e.g., a column) has a URL that can be dereferenced. We can distinguish the following types of resources: the resources that are created by a program, and the resources that existed before the program execution.

Resources that are created in the program are, for instance, a column created in the program, and a custom class. A URL must be created for these resources. The way to define the URL depends on the storage we define for the serialization of the RDF graph. For example, if the RDF graph is saved as a file accessible in a URL u, then the natural way to define the URLs for all the objects and custom classes defined by the program is to use u as a prefix. It would be useful to include the Turtle clauses @base and @prefix in the file.

Writing RDF files into a publicly available file is probably the simplest way to create URL for objects. In some settings may need the interaction between the program with a server that is responsible for storage and URI creation.

On the other hand, if the URL of the object or class was defined before, then we do not need to create a new URL, but reference the existing URL. This happens in two cases. First, all standard BHoM classes should be defined in a public available ontology, that does not depend on a particular program. This way, all graphs generated by programs will use and refer the same ontology. Second, a program my read files that were created before (e.g., by other programs). A column described in one of these files may have their own URL, so it is not needed to create a new URL if that column is intended to be the same as in our program. Hence, the program must save the URLs of objects and custom classes created in other programs.

It should be noticed that it is relevant to determine when the column is "intended to be the same". We may add information to the column without changing its identity. However, it may be convenient to create a new column if we change inherent properties of the column, as the size, materials, etc.