After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701828 - NFO - Add backgroundColor and htmlNoteContent
NFO - Add backgroundColor and htmlNoteContent
Status: RESOLVED OBSOLETE
Product: tracker
Classification: Core
Component: Ontology
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: tracker-general
tracker-general
Depends on:
Blocks:
 
 
Reported: 2013-06-07 22:40 UTC by Pierre-Yves Luyten
Modified: 2021-05-26 22:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add two properties to NFO (1.42 KB, patch)
2013-06-07 22:42 UTC, Pierre-Yves Luyten
needs-work Details | Review
Add two properties (1.44 KB, patch)
2013-06-20 22:35 UTC, Pierre-Yves Luyten
committed Details | Review

Description Pierre-Yves Luyten 2013-06-07 22:40:50 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
Comment 1 Pierre-Yves Luyten 2013-06-07 22:42:13 UTC
Created attachment 246285 [details] [review]
Add two properties to NFO
Comment 2 Martyn Russell 2013-06-12 10:21:05 UTC
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).
Comment 3 Pierre-Yves Luyten 2013-06-20 22:35:15 UTC
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.
Comment 4 Pierre-Yves Luyten 2013-06-20 22:36:24 UTC
>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 5 Martyn Russell 2013-06-26 12:06:59 UTC
Comment on attachment 247391 [details] [review]
Add two properties

Looks good to me, please go ahead and commit.
Comment 6 Pierre-Yves Luyten 2013-06-26 21:46:20 UTC
Comment on attachment 247391 [details] [review]
Add two properties

commit 6c1885f241880b528d29c2270022dac2bdd5be86

I will tell relevant note editors maintainers in case they are interested
Comment 7 Philip Van Hoof 2013-07-11 11:25:24 UTC
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.
Comment 8 Philip Van Hoof 2013-07-11 11:26:48 UTC
ps. Bug should be reopened and ontology changes reverted.
Comment 9 Martyn Russell 2013-07-11 15:41:45 UTC
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.
Comment 10 Jürg Billeter 2013-07-11 15:45:19 UTC
I agree with Philip here, xmlContent doesn't make sense in Nepomuk. xmlContent is conceptually equivalent to applicationSpecificBlob.
Comment 11 Martyn Russell 2013-07-11 15:51:31 UTC
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.
Comment 12 Pierre-Yves Luyten 2013-07-11 15:54:56 UTC
Sure as said on the ml the commit will be reverted, and i hope the discussion will go on there
Comment 13 Sam Thursfield 2021-05-26 22:25:12 UTC
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.