Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Embedding blocks from other pages #8

Open
agentydragon opened this issue Feb 6, 2021 · 0 comments
Open

[Feature request] Embedding blocks from other pages #8

agentydragon opened this issue Feb 6, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@agentydragon
Copy link
Contributor

Background
One very useful feature in Roam Research is that you can embed blocks from one page in another page, or in another block. You can for example do something like:

  • Assumptions:
    • Socrates is a man
    • All men are mortal
  • Rules:
    • If P(X) for all X having Q(X), and Q(a), then P(a)
  • Deductions:
    • Socrates is mortal
  • Applying ((If P(X) for all X having Q(X), and Q(a), then P(a))) to ((Socrates is a man)) and ((All men are mortal)), we get ((Socrates is mortal))

For blocks, Roam also tracks where they are referenced.

Implementation idea
I think to implement this, it would be good to switch from storing the Slate pages directly as JSON (in a custom property) to creating a custom schema and storing them as entities.

So, for example, from this Turtle:

@prefix : <#>.
@prefix voc: <https://face.baby/vocab#>.

:concept
    voc:noteBody
        """[{"children":[{"text":"Hello World!"}]},{"children":[{"text":"Reference to "},{"type":"concept","children":[{"text":"[[Testing Concept 2]]"}],"name":"Testing Concept 2"},{"text":""}]}]""".

To this Turtle (based on https://ontola.io/blog/ordered-data-in-rdf/):

@prefix : <#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix voc: <https://face.baby/vocab#>.

:concept voc:noteBody :noteBody .
:noteBody rdf:_1 :block51451 .
:noteBody rdf:_2 :block54342 .
:noteBody rdf:_3 :block94329 .

:block51451 voc:blockType voc:Text ;
  voc:blockText "Hello World!" .

:block54342 voc:blockType voc:Text ;
  voc:blockText "Reference to " .

:block94329 voc:blockType voc:ConceptBlock ;
  voc:blockText "[[Testing Concept 2]]" ;
  voc:conceptName "Testing Concept 2" .

With this representation, you could have a note embed another note's block by just adding a triple linking to it.

@agentydragon agentydragon added the bug Something isn't working label Feb 6, 2021
@Piyopiyo-Kitsune Piyopiyo-Kitsune added enhancement New feature or request and removed bug Something isn't working labels Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants