<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    uh, why invent something new when this has been implemented in
    "fresnel" before? <br>
    <br>
    there is a standard for such configuration files:<br>
    <a class="moz-txt-link-freetext" href="http://www.w3.org/2005/04/fresnel-info/">http://www.w3.org/2005/04/fresnel-info/</a><br>
    <br>
    I would try to base my approach on fresnel and extensions, for
    example a scripting language... <br>
    <br>
    Here an example we used in nepomuk for showing/hiding properties<br>
    @prefix :
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/11/01/pimo-fresnel#">&lt;http://www.semanticdesktop.org/ontologies/2007/11/01/pimo-fresnel#&gt;</a>
    .<br>
    @prefix rdfs: <a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2000/01/rdf-schema#">&lt;http://www.w3.org/2000/01/rdf-schema#&gt;</a> .<br>
    @prefix XMLSchema: <a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema#">&lt;http://www.w3.org/2001/XMLSchema#&gt;</a> .<br>
    @prefix nao:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#">&lt;http://www.semanticdesktop.org/ontologies/2007/08/15/nao#&gt;</a> .<br>
    @prefix ncal:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#">&lt;http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#&gt;</a> .<br>
    @prefix nco:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#">&lt;http://www.semanticdesktop.org/ontologies/2007/03/22/nco#&gt;</a> .<br>
    @prefix nfo:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#">&lt;http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#&gt;</a> .<br>
    @prefix nmo:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#">&lt;http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#&gt;</a> .<br>
    @prefix nie:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#">&lt;http://www.semanticdesktop.org/ontologies/2007/01/19/nie#&gt;</a> .<br>
    @prefix nrl:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#">&lt;http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#&gt;</a> .<br>
    @prefix pimo:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#">&lt;http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#&gt;</a> .<br>
    @prefix rdf: <a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#">&lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;</a> .<br>
    @prefix wgs84_pos: <a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2003/01/geo/wgs84_pos#">&lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt;</a>
    .<br>
    @prefix fresnel: <a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2004/09/fresnel#">&lt;http://www.w3.org/2004/09/fresnel#&gt;</a> .<br>
    @prefix fredit:
    <a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ont/2008/05/23/fredit#">&lt;http://www.semanticdesktop.org/ont/2008/05/23/fredit#&gt;</a> .<br>
    <br>
    # our extensions<br>
    <br>
    # we filter beforehand showing only<br>
    # sub-properties of objectProperty and datatypeProperty<br>
    <br>
    # a lens applying to all instances of pimo:Thing<br>
    :ThingLens rdf:type fresnel:Lens ;<br>
    &nbsp;&nbsp;&nbsp; fresnel:classLensDomain pimo:Thing;<br>
    &nbsp;&nbsp;&nbsp; fresnel:purpose fresnel:defaultLens;<br>
    &nbsp;&nbsp;&nbsp; fresnel:showProperties ( <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:isRelated<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:hasTopic<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:isTopicOf<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:hasPart<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:partOf<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fresnel:allProperties<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:groundingOccurrence<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:referencingOccurrence <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>
    .<br>
    <br>
    :PropertyLens rdf:type fresnel:Lens ;<br>
    &nbsp;&nbsp;&nbsp; fresnel:classLensDomain rdf:Property;<br>
    &nbsp;&nbsp;&nbsp; fresnel:showProperties ( <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:label<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:comment<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:domain<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:range<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:subPropertyOf<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nrl:inverseProperty<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fresnel:allProperties<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>
    .<br>
    <br>
    :ClassLens rdf:type fresnel:Lens ;<br>
    &nbsp;&nbsp;&nbsp; fresnel:classLensDomain rdfs:Class;<br>
    &nbsp;&nbsp;&nbsp; fresnel:showProperties ( <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:label<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:description<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:subClassOf<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fresnel:allProperties<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>
    .<br>
    <br>
    :naoDescriptionFormat a fresnel:Format;<br>
    &nbsp; fredit:valueWidget&nbsp; [ a fredit:TextAreaWidget ];<br>
    &nbsp; fresnel:propertyFormatDomain nao:description .<br>
    <br>
    # a Purpose to show metadata<br>
    :MetadataLens a fresnel:Purpose;<br>
    &nbsp;&nbsp;&nbsp; rdfs:comment "Show the metadata of a something".<br>
    <br>
    # a Purpose to show all properties including relating properties<br>
    :FullLens a fresnel:Purpose;<br>
    &nbsp;&nbsp;&nbsp; rdfs:comment "Show the data and relations of something".<br>
    <br>
    <br>
    # a lens to show the metadata of a thing<br>
    :ThingMetadataLens rdf:type fresnel:Lens ;<br>
    &nbsp;&nbsp;&nbsp; fresnel:classLensDomain pimo:Thing;<br>
    &nbsp;&nbsp;&nbsp; fresnel:purpose :MetadataLens;<br>
    &nbsp;&nbsp;&nbsp; fresnel:showProperties ( <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:comment<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:created<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:lastModified<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:creator<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:groupOwner<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:isDefinedBy<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )<br>
    .<br>
    <br>
    # A lens to show information elements and things in full<br>
    :GenericLens rdf:type fresnel:Lens ;<br>
    &nbsp;&nbsp;&nbsp; fresnel:classLensDomain nie:InformationElement, pimo:Thing;<br>
    &nbsp;&nbsp;&nbsp; fresnel:purpose :FullLens;<br>
    &nbsp;&nbsp;&nbsp; fresnel:showProperties ( <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:label<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:subject<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:title<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nfo:fileName<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdf:type<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rdfs:comment<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:description<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:wikiText<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:comment<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:created<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:lastModified<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:creator<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nco:publisher<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nco:creator<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:contentSize<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:groupOwner<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pimo:isDefinedBy<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:identifier<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:isStoredAs<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:keyword<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:relatedTo<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fresnel:allProperties<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # plaintextcontent AFTER allproperties to have place<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:plainTextContent&nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nmo:plainTextMessageContent<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:dataSource<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nfo:belongsToContainer<br>
    &nbsp;&nbsp;&nbsp; );<br>
    &nbsp;&nbsp;&nbsp; fresnel:hideProperties (<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:created<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nao:lastModified<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:contentCreated<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:contentLastModified<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:generator<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:generatorOption<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:hasLogicalPart<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:hasPart<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:informationElementDate<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:isLogicalPartOf<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:language<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:legal<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:links<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:rootElementOf<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:mimeType <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:version<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nfo:fileLastModified<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nie:interpretedAs<br>
    &nbsp;&nbsp;&nbsp; )<br>
    .<br>
    <br>
    <br>
    <br>
    It was Sebastian Trueg who said at the right time 16.09.2010 10:49
    the following words:
    <blockquote cite="mid:4C91DA17.3090901@kde.org" type="cite">
      <pre wrap="">I took some time on the train and here is one proposal that we could
discuss:

I started with the following issues that the display rules need to address:
input:
  * 1 resource or resource type
  * 1 or more properties (using multiple properties allows to merge
    them like with image dimensions or to combine information that
    matches into a readable expression)
  * value for each property (as Variant, ie. lists are supported)

output:
  * a Qt-style richt-text string with optional links (queries or other
    local or remote URLs)
  * how about pixmaps? icons should be easy to integrate...
  * how about a template system which allows to replace variables with
    values or query results. the latter would require a tool for query
    generation

rule registration:
  * supported type
  * supported property
  * optional: supported value type (in case of non-literal ranges)

rule selection:
  * be greedy
  * try to find the best matching rule via type and properties that are
    as specialized as posssible

The I drafted one random example trying to include the full syntax:
&lt;rule&gt;
  &lt;resourceType uri=foobar /&gt;
  &lt;resourceType uri=xyz /&gt;
  &lt;propertyGroup&gt;
    &lt;property name=p1 uri=abc /&gt;
    &lt;property name=p2 uri=def /&gt;
  &lt;/propertyGroup&gt;
  &lt;variable name="a" type=string&gt;
    &lt;propertyValue property=p1 /&gt;
  &lt;/variable&gt;
  &lt;variable name="b" type=uri&gt;
    &lt;propertyValue property=p2 /&gt;
  &lt;/variable&gt;
  &lt;query name="myquery"&gt;
    &lt;sparql&gt;select ?r where { ?r nao:hasTag &lt;%r&gt; . }&lt;/sparql&gt;
  &lt;/query&gt;
  &lt;variable name="c" type=domain&gt;
    &lt;binding query="myquery" bindingName="r" /&gt;
  &lt;/variable&gt;
  &lt;query name="queryThatDependsOnAnotherVariable"&gt;
    &lt;sparql&gt;select ?r where { ?r &lt;foobar&gt; &lt;%c&gt; . }&lt;/sparql&gt;
  &lt;/query&gt;
  &lt;query name="q1" queryFiles="true" queryFolders="true" limit="0"
         offset="0" fullTextScoring="false" fullTextScoringOrder="asc"
         flags=""&gt;
    &lt;comparison
property=<a class="moz-txt-link-rfc2396E" href="http://www.semanticdesktop.org/ontologies/2007/08/15/nao#hasTag">"http://www.semanticdesktop.org/ontologies/2007/08/15/nao#hasTag"</a>
comparator="=" inverted="false"&gt;
      &lt;resource uri="%r"/&gt;
    &lt;/comparison&gt;
  &lt;/query&gt;
  &lt;variable name="d"&gt;
    &lt;binding query="q1" bindingIndex=0 /&gt;
  &lt;/variable&gt;
  &lt;template&gt;Something blabla &amp;lt;a href="%b"&amp;gt;%a&amp;lt;/a&amp;gt;&lt;/template&gt;
  &lt;icon name="nepomuk" /&gt;
&lt;/rule&gt;

The generic fallback rule (the absence of resourceType and property uri
mean: no restriction, i.e. all apply):
&lt;rule&gt;
  &lt;propertyGroup&gt;
    &lt;property name=p1 /&gt;
  &lt;/propertyGroup&gt;
  &lt;variable name="a"&gt;&lt;propertyLabel property=p1 /&gt;&lt;/variable&gt;
  &lt;variable name="b"&gt;&lt;propertyValue property=p1 /&gt;&lt;/variable&gt;
  &lt;template&gt;%a: %b&lt;/template&gt;
&lt;/rule&gt;

Example 1: download location
&lt;rule name="download location"&gt;
  &lt;resourceType uri=nfo:FileDataObject /&gt;
  &lt;propertyGroup&gt;
    &lt;property uri=ndo:copiedFrom name="copiedFrom" /&gt;
  &lt;/propertyGroup&gt;
  &lt;query name="referrerQuery"&gt;&lt;sparql&gt;select ?ref where { ?dl a
ndo:DownloadEvent . ?dl nuao:involces &lt;%r&gt; . ?dl ndo:referrer ?ref . }
limit 1&lt;/sparql&gt;&lt;/query&gt;
  &lt;variable name=refUrl type=uri&gt;
    &lt;binding query="referrerQuery" bindingName="ref" /&gt;
  &lt;/variable&gt;
  &lt;variable name=refUrl type=label&gt;
    &lt;binding query="referrerQuery" bindingName="ref" /&gt;
  &lt;/variable&gt;
  &lt;template i10l-context="blablabla blabla"&gt;Downloaded from &amp;lt;a
href="%refUrl"&amp;gt;%label&amp;lt;/a&amp;gt;&lt;/template&gt;
  &lt;template lang="de"&gt;Geladen von &amp;lt;a
href="%refUrl"&amp;gt;%label&amp;lt;/a&amp;gt;&lt;/template&gt;
&lt;/rule&gt;


A few facts:
* There is one special variable: %r which is always replaced by the
resource's URI.
* With a sparql or desktop query only the first binding is used.
* A variable can have an optional type. This is mostly useful to get
  the genericLabel for resources or specifically select the URI
  - uri - the resource URI - will be ignored for literal bindings
  By default all values are converted into strings creating pretty
  values for dates and times and number values. TODO: let
  Resosurce:genericLabel() extract the domain from http URLs?
* Use %% to include a percent character in the template.
* If a variable has no value (empty query results) the rule fails and
  then next is used
* What is a PropertyGroup? The idea is to support multiple properties
  in a single rule. But since a rule can also "merge" several
  properties' values we need a distinction between a group of
  properties that can be "merged" and properties that can all be
  handled by the rule. As an example a rule may provide the same
  formatting for property A and B which would be realized as 2
  propertyGroups. Another rule would take two properties as input and
  put them in a single template. This would be done using a single
  propertyGroup.
* The syntax for the queries is the same as created and parsed by
  Query::toString() and Query::fromString(). The only exception is the
  additional "name" attribute.
* Do we need if/then/else constructs? Answer: even if we do we can
  perfectly introduce them later on as variable constructs which allow
  to choose between other variables or constants.

Open Questions:
* How do we create query links? By specifying the nepomuksearch:/ URL
  directly? That would make dynamic queries harder. But how would we do
  dynamic queries anyway?
* Does the "icon" make sense? It would be displayed in front of the
  label or something.
* We could use some sort of rule weight to prioritize them in addition
  to the automatic priorization mentioned above
* Why XML and not RDF: 1. XML is simpler in this case. 2. I don't see
  the advantage of having the rules in the database (I might be
  mistaken though). 3. FIXME: check the RDF dialect again which allows
  to describe something like this but AFAIK without queries. ON THE
  OTHER HAND: If we had an RDF dialect we could 1. store rules with the
  ontologies, 2. query appropriate rules via SPARQL, 3. have a database
  that supports the formatting rule through a sparql extension...

Well, this is my braindump. Now please ask, comment, and discuss away. :)

Cheers,
Sebastian

On 09/14/2010 05:19 PM, Sebastian Tr&uuml;g wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Actually I only meant the rule thing, not the whole
resource-visualization plugin stuff. So in the end the goal is "only" to
come up with a way to describe the points I outlined using XML or some
other format. Then we need to parse that and implement a generator which
should be fairly easy.
Thus, all in all the problematic part is the rule format.

Cheers,
Sebastian

On 09/14/2010 05:08 PM, Matthias Fuchs wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Looks really complex, I guess this is over my knowledge of most Nepomuk 
Ontologies -- thus also what could be an requirement.

You mentioned one of your tries. Do you think that future tries would involve 
less code, e.g. looking at the bibtex example?
Because that example really outlines that either using C++ is not that useful 
for this task -- too code needed, e.g. subclassing -- or maybe a system 
depending on something different should be used.

In that case I am afraid that I'm not really useful in drafting such system 
that would really work and be efficient. I guess I could implement support for 
some ontologies once it is drafted but I suppose this would be the easiest 
part anyway.

Am Montag 13 September 2010, 09:53:36 schrieb Sebastian Tr&uuml;g:
</pre>
          <blockquote type="cite">
            <pre wrap="">Hi Matthias,

thanks for putting the problem out there.
So far most of the information we have on files are legacy key/value
pairs with literal values like file size, image dimensions, title, and
so on. And even resource values like artists and albums could simply be
handled by displaying the corresponding resource's label. But as more
and more elaborate information enters Nepomuk this solution does not
work anymore.
The first time this happened (download locations) I create an ugly hack
which queries the download event for details like the download and the
referrer URL. This is of course a bad solution since we cannot create a
special case for all types of information we could encounter.
Thus, the idea is in fact to create a rule system.

Such a rule system would consist of rules (who would have thought) which
convert a property into something displayable. As input it needs more
than just the value which is obvious. But I think it even needs more
than the property and the value since we have rather generic properties
like "creator" which are used in all kinds of situations. A typical
example are audio files where "creator" is used for the artist. Thus,
the rule needs to know the type of the subject in order to decide
whether to use "artist" or "author" or the generic "creator".
Thus, one rule needs at least the following input:
 * The resource type (maybe even a list of types of the resource
   itself?)
 * The property
 * The value
Based on this information the rule should be able to
 * Add fixed text (maybe even rich-text formatted)
 * Add links (to other resources and web URLs and even to queries)
 [* Define actions?]

I already tried this at least once. And in playground[1] you can find a
very bad first version of such a rule system.
So we need to come up with a much better system and syntax as the one I
drafted in playground. An idea is to use XML since it is easy to parse.
But writing and reading it can be a pain.

Thus - ideas and comments please.

Cheers,
Sebastian

[1]
<a class="moz-txt-link-freetext" href="http://websvn.kde.org/trunk/playground/base/nepomuk-kde/resource-visualizat">http://websvn.kde.org/trunk/playground/base/nepomuk-kde/resource-visualizat</a>
ion/ and
<a class="moz-txt-link-freetext" href="http://websvn.kde.org/trunk/playground/base/nepomuk-kde/resource-visualizat">http://websvn.kde.org/trunk/playground/base/nepomuk-kde/resource-visualizat</a>
ion/sample.rules?view=markup

On 09/10/2010 11:50 PM, Matthias Fuchs wrote:
</pre>
            <blockquote type="cite">
              <pre wrap="">Hi,

I discussed a problem on irc and sebastian trueg mentioned that I should
also write on it here.

The problem is that there is no graphical representation of information
that is interconnected.

Take NFO::hashAlgorithm and NFO::hashValue as example. At the moment both
are displayed in their own line and there is no visual link between
them. Now if more algorithms and values were added it would get a little
complicated for the user to associate the correct values with the
algorithms.

Ideally both would be displayed in one line, e.g. "SHA1 hash:
325e69d24514f7b26834a93ad260f3024127714b".


Though this solution would most likely not apply to other information
that should also be graphically grouped. Sebastian mentioned that he
tried to create a solution for this once with having an xml file and
another time with a custom format.

So as he put it there is a need for a rule system to graphically
represent the information.



PS.: Grouping information graphically would also the advantage of making
information easier hideable/collapsible.
PPS.: I created a bug report for this
<a class="moz-txt-link-freetext" href="https://bugs.kde.org/show_bug.cgi?id=250819">https://bugs.kde.org/show_bug.cgi?id=250819</a>

_______________________________________________
Nepomuk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/nepomuk">https://mail.kde.org/mailman/listinfo/nepomuk</a>
</pre>
            </blockquote>
            <pre wrap="">
_______________________________________________
Nepomuk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/nepomuk">https://mail.kde.org/mailman/listinfo/nepomuk</a>
</pre>
          </blockquote>
          <pre wrap="">
_______________________________________________
Nepomuk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/nepomuk">https://mail.kde.org/mailman/listinfo/nepomuk</a>

</pre>
        </blockquote>
        <pre wrap="">_______________________________________________
Nepomuk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/nepomuk">https://mail.kde.org/mailman/listinfo/nepomuk</a>

</pre>
      </blockquote>
      <pre wrap="">_______________________________________________
Nepomuk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/nepomuk">https://mail.kde.org/mailman/listinfo/nepomuk</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Leo Sauermann, Dr.
CEO and Founder

mail: <a class="moz-txt-link-abbreviated" href="mailto:leo.sauermann@gnowsis.com">leo.sauermann@gnowsis.com</a>
mobile: +43 6991 gnowsis           
<a class="moz-txt-link-freetext" href="http://www.gnowsis.com">http://www.gnowsis.com</a>

helping people remember,

so join our newsletter
<a class="moz-txt-link-freetext" href="http://www.gnowsis.com/about/content/newsletter">http://www.gnowsis.com/about/content/newsletter</a>
____________________________________________________
</pre>
  </body>
</html>