You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Download the roam JSON export. And run the following regex on the file:
Search: "string":"([^"]+)::
Replace with: "string":"[[$1]]
Now, import the JSON to logseq.
Alternative
Personally, I kept the :: at the end of these attribute-references, to style these a bit different in logseq:
Search: "string":"([^"]+)::
Replace with: "string":"[[$1::]]
Now, these "special" tag links can be styled differently by using the following CSS snippet:
/* Style of my Roam Attributes */
span.page-reference a[data-ref*="::"] {
background: #ffb86c;
color: #282a36;
}
Thank you for the temp workaround!
I've thought of that converting the roam attributes to logseq's properties (for both pages and blocks), this way, the properties can be structural data for queries.
But roam's attributes can be mixed in the block content, and we don't have clear rules to extract the attribute's value.
Any ideas?
What do you mean by "mixed in the block content"? Aren't Roam's attributes each on one line? Whatever comes before the :: is the name and whatever comes after is the value? Sorry if I'm misunderstanding. It would be great to be able to convert roam's attributes to logseq's properties.
I think not even that assumption can be made. At least not for every user. Fundamentally, as they are identical to normal page-refs, I would argue converting them to page-refs is the only way which works for every use-case.
I agree that many users including me used them as something that would make sense to be converted into properties. But I think this maybe should not be default.
@lezuber For a 100% valid transformation, what you say makes complete sense. An option that would work for most cases would also be convenient. Most people would have single line attributes without nested content. But for non destructive import, an option for flattening the attribute contents into single line in logseq might make sense.
Or if logseq supports querying parent nodes given some property of child nodes, I guess leaving it as page ref would by itself be functional.
I'm curious what you would suggest for Roam attributes of the following form:
Tags:: #Logseq #Video #PKM #[[Smart Notes]]
(basically, an attribute with several tags/references)
If the Roam JSON file was updated to turn it into a comma-separated list, would it play nice with Logseq properties when imported into Logseq?
@swordthrower that's my most common use case for Roam attributes as well (i.e. including a block at the top of a page with multiple tags, or other attribute titles), which would directly translate to page tags / properties in Logseq if they were parsed in with commas. I agree as @tiensonqin said that it's a bit tricky to know what logic to apply in some of the more ambiguous situations, but I feel like this would cover a lot of use cases.
@lezuber are you still able to do the following to style the attributes? Due to colon (:) being a special character, I am not able to use it at all even after trying to escape it with either ":" or "\003A"
/* Style of my Roam Attributes /
span.page-reference a[data-ref="::"] {
background: #ffb86c;
color: #282a36;
}
Activity
lezuber commentedon Feb 17, 2021
I've set up a temp workaround for this now. Explanation for semi-technical folks:
It uses so called regular expressions (regex). Good text editors e.g. SublimeText support a regex out of the box:
Download the roam JSON export. And run the following regex on the file:
Search:
"string":"([^"]+)::Replace with:
"string":"[[$1]]Now, import the JSON to logseq.
Alternative
Personally, I kept the
::at the end of these attribute-references, to style these a bit different in logseq:Search:
"string":"([^"]+)::Replace with:
"string":"[[$1::]]Now, these "special" tag links can be styled differently by using the following CSS snippet:
tiensonqin commentedon Feb 19, 2021
Thank you for the temp workaround!
I've thought of that converting the roam attributes to logseq's properties (for both pages and blocks), this way, the properties can be structural data for queries.
But roam's attributes can be mixed in the block content, and we don't have clear rules to extract the attribute's value.
Any ideas?
arminta7 commentedon Feb 19, 2021
What do you mean by "mixed in the block content"? Aren't Roam's attributes each on one line? Whatever comes before the :: is the name and whatever comes after is the value? Sorry if I'm misunderstanding. It would be great to be able to convert roam's attributes to logseq's properties.
lezuber commentedon Feb 26, 2021
I think not even that assumption can be made. At least not for every user. Fundamentally, as they are identical to normal page-refs, I would argue converting them to page-refs is the only way which works for every use-case.
I agree that many users including me used them as something that would make sense to be converted into properties. But I think this maybe should not be default.
sai-prasanna commentedon Aug 8, 2021
@lezuber For a 100% valid transformation, what you say makes complete sense. An option that would work for most cases would also be convenient. Most people would have single line attributes without nested content. But for non destructive import, an option for flattening the attribute contents into single line in logseq might make sense.
Or if logseq supports querying parent nodes given some property of child nodes, I guess leaving it as page ref would by itself be functional.
swordthrower commentedon Nov 20, 2021
I'm curious what you would suggest for Roam attributes of the following form:
Tags:: #Logseq #Video #PKM #[[Smart Notes]]
(basically, an attribute with several tags/references)
If the Roam JSON file was updated to turn it into a comma-separated list, would it play nice with Logseq properties when imported into Logseq?
abehr commentedon Nov 20, 2021
@swordthrower that's my most common use case for Roam attributes as well (i.e. including a block at the top of a page with multiple tags, or other attribute titles), which would directly translate to page tags / properties in Logseq if they were parsed in with commas. I agree as @tiensonqin said that it's a bit tricky to know what logic to apply in some of the more ambiguous situations, but I feel like this would cover a lot of use cases.
swordthrower commentedon Nov 22, 2021
Thanks, @abehr . I will play around with modifying the JSON Roam export before importing to Logseq.
vasusen commentedon Jan 23, 2022
@lezuber are you still able to do the following to style the attributes? Due to colon (:) being a special character, I am not able to use it at all even after trying to escape it with either ":" or "\003A"