Links as RDF tuples or edge properties for links

I was wondering, is it possible to put properties on links (edge properties) using wikilink or backlink approach. In other words, will it be possible to achieve something like RDF triplets/tuples (subject, predicate, object)

The following list is just for demonstration purposes:

  • [[x]] [[depends_on]] [[y]]
  • [[author1]] [[hypotesize]] [[ideaA]]
  • [[paper1]] [[shows|proves]] [[ideaA]]
  • [[conceptX]] [[build_upon]] [[ideaA]]
  • [[paper1]] [[cites]] [[paper2]]
  • [[paper1]] [[cited_by]] [[paper3]]
  • [[paper1]] [[conflicts]] [[paper4]]

in this example, while viewing the note for paper1, in side panel, we should see it cites paper2, was cited by paper3 and it conflicts with paper4.

Ideally, it would be nice to have edge properties, as in Neo4j, and in graph view we might see that:
author1 --hypothesize-> ideaA <-shows-- paper1 --cites-> paper2

10 Likes

Wow! I went deep into the Neo4j rabbit hole a couple of years ago. But I didn’t have a use case of my own to pursue Neo4j further. Besides, I found that not having a friendly GUI (as in MS Access or Filemaker with SQL databases) really made Neo4j cumbersome for me. But if I saw inspiration for a Zettelkasten hosted in Neo4j, I would be back into it in a heartbeat.

2 Likes

Hi @kdjamesrd, I’m glad we have similar interest. As you mentioned having Neo4j within markdown files might be difficult. But I noticed another interesting implementation; Semantic MediaWiki.

This example is taken from help page:
In Berlin page, you can have a entry like this: [[Germany]] which will make straight (an ordinary link, no properties), however, Semantic MediaWiki allows, link with properties with this syntax: [[Is capital of::Germany]] . Now, we have special link between Berlin and Germany. You can have as many “properties” as you like. What about [[Has population::3,396,990]] ?

This is just the beginning. The connections are kept in SQL database (as rdf tuples AFAIK) so SPARQL queries are possible. For example,

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population 
 |?Area#km² = Size in km²
}}

will generate a table of cities in Germany, listing their populations and areas. Help section about inline queries has more examples and explanations.

Wouldn’t it be cool to have semantic links between markdown notes? :wink:

6 Likes

I can imagine this existing as a plug-in. Hmm! Interesting ideas!

3 Likes

Here’s a markup language, Aspen, which converts plain text into graph (to Neo4J, to be exact, via Cyper). At the end, we have edge properties for the connections.

4 Likes

That is a cool project! Thanks for sharing.

1 Like

that suggestion is a game changer. I think any software implement this functionality will transform writing apps. beyond that dream a writing app that can query Wikidata via sparql. use sparql results as variable or obsidian note. will return obsidian to living organism. don’t mentioning using api request results. All in one knowledge management base for individuals an organisations. hard to implement I guess.
Dear Alper Yılmaz those I wrote is my dream app. It’s also absolutely need for academic works. By the way Türkiye’den selamlar :slight_smile:

2 Likes

I was doing something similar using the YAML frontmatter to express triples with the implicit subject being the topic of the document itself, and property: value. I treated [[value]] an array-of-arrays containing value as a reference to the document with value as the name and then I slurped the whole objectspace of my markdown repository into an in-memory database so I could use SPARQL to perform queries on it and emit a table of the results.

I’ve written something like this as a script multiple times and keep hoping someone would just bake it into their product and SURPRISED nobody has done so yet.

I don’t know how to leverage it with Obsidian directly because it’s a post-processing operation that I use when rendering the markdown to HTML so I don’t know if I can make a plugin for Obsidian yet, but if people are interested in this I can try.

For reference, I’m using the npm package rdfstore to do the heavy lifting and I’m writing some glue code around markdown parsing and fixing rdf namespaces and massaging values for the queries.

1 Like

I like the Semantic MediaWiki syntax for semantic links (i.e. [[property name::link]]).

This related thread is also worth mentioning:

3 Likes

I had just expressed a semantic network technique as a general solution to capture info, with a way to express edge types in Obsidian:

https://forum.obsidian.md/t/how-do-you-manage-news-and-history-related-topics/2685/53

I tend to shy away from special-purpose tools and layers of add-on complexity in order to keep the maintenance minimal and reduce the chance that a foundational tool will break / drop support, and my whole data structure comes crashing down.

On the way towards plugin, Here is one initial working example of integrating Neo4j with Obsidian. I do not know if author @Emile would appreciate help from other experienced people.

1 Like