GNOME Bugzilla – Bug 701828
NFO - Add backgroundColor and htmlNoteContent
Last modified: 2021-05-26 22:25:12 UTC
Notes have sometimes rich text and background color. Storing it into Tracker would be a nice improvement. HTML Exporting to this format is a convenient way to store the data. Anyone can embed html. BACKGROUND COLOR I'm suggesting rgba (r, g, b, a) because it is a standard and still convenient for widgets : gdk_rgba_parse would create a valid GdkRGBA from string without conversion. The background color is not directly attached to the HTML, so color can be retrieved / updated without touching HTML. See discussion https://mail.gnome.org/archives/tracker-list/2013-June/msg00010.html
Created attachment 246285 [details] [review] Add two properties to NFO
Comment on attachment 246285 [details] [review] Add two properties to NFO Hello, my comments below: >--- a/data/ontologies/33-nfo.ontology >+++ b/data/ontologies/33-nfo.ontology >@@ -12,7 +12,7 @@ > > nfo: a tracker:Namespace, tracker:Ontology ; > tracker:prefix "nfo" ; >- nao:lastModified "2011-12-15T18:51:25Z" . >+ nao:lastModified "2013-06-08T00:34:25Z" . Thanks, we always forget to update this :D it's quite important. > nfo:Document a rdfs:Class ; > rdfs:label "Document" ; >@@ -569,6 +569,18 @@ nfo:Note a rdfs:Class ; > rdfs:comment "Usually small document with snippets, reminders or frequenly used content."; > rdfs:subClassOf nfo:Document . > >+nfo:backgroundColor a rdf:Property ; >+ rdfs:comment "Textual representation of a color, respecting CSS3 rgba format" ; >+ nrl:maxCardinality 1 ; >+ rdfs:domain nfo:Note ; >+ rdfs:range xsd:string . >+ >+nfo:htmlNoteContent a rdf:Property ; Hmm, I would use nfo:xmlContent because HTML is a subset of it. >+ rdfs:comment "HTML representation of a note" ; I would also make this "XML/HTML/etc content" >+ nrl:maxCardinality 1 ; >+ rdfs:domain nfo:Note ; Not sure about the nfo:Note domain here. XML/HTML content isn't always a note. I would probably make this either nfo:Document or nfo:TextDocument as the domain (depending on the super properties you want).
Created attachment 247391 [details] [review] Add two properties This patch adds the xmlContent to nfo:Document (so nfo:Note or nfo:HtmlDocument can use it) and nfo:backgroundColor specifically for notes.
>Not sure about the nfo:Note domain here I changed the domain for the xmlContent. Hmm, actually we might also want this domain change for background color?
Comment on attachment 247391 [details] [review] Add two properties Looks good to me, please go ahead and commit.
Comment on attachment 247391 [details] [review] Add two properties commit 6c1885f241880b528d29c2270022dac2bdd5be86 I will tell relevant note editors maintainers in case they are interested
I disagree with this approach. We should not put formatted content into the Nepomuk storage: The field is useless for any other application but the hosting application. We can't query it, because its contents are formatted and we don't have query capabilities to query your formatted contents. And even if we would allow storage of formatted content like XML, we should enforce the format using a DTD or other XML schema so that we're sure that the inserted format is valid and known. Neither of that is what nfo:xmlContent specifies, so I think it does not belong in the ontology at all. Tracker's Nepomuk storage isn't a freeform 'store whatever you want' with the sole exception of nie:plainTextContent (which I honestly dislike a lot for the same reason). If GNOME Notes wants to store notes in Tracker, then it should store data and metadata in it. And store UI data, like X/Y positions and list offsets or indexes by itself. This simply does not belong in Tracker, at all. Allowing GNOME application to store whatever they want, using XML or not (as I don't care about the actual format), is crazy. Model your application correct and store information correct. Don't abuse Tracker to solve your 'whatever' storage needs. And XML is indeed 'whatever', just like JSON, binary, CSV, etc are: we can't use them in SPARQL.
ps. Bug should be reopened and ontology changes reverted.
In fairness, the background color is the only part I am not happy with, the xmlContent part I think is fine. I wouldn't revert this fully. I also argued previously that if we need style formatting, it should be more generic, like a CSS text buffer. I tend to agree with Philip that we should revert part of this. Sorry Pierre-Yves.
I agree with Philip here, xmlContent doesn't make sense in Nepomuk. xmlContent is conceptually equivalent to applicationSpecificBlob.
Jürg you're right. This is why I like to have proper review of ontology changes - I think in the future we should go via the mailing list to get full feedback... I'm not always the best person to decide on my own.
Sure as said on the ml the commit will be reverted, and i hope the discussion will go on there
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new enhancement request ticket at https://gitlab.gnome.org/GNOME/tracker/-/issues/ Thank you for your understanding and your help.