Template sorting on the w3 rdf-syntax 'type' predicate

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Template sorting on the w3 rdf-syntax 'type' predicate

Valentin LAB
Hi,

This works : (sorting by label)
---
<tree id="treeClass"
     ...
     sortResource="http://www.w3.org/2000/01/rdf-schema#label"
     sortDirection="ascending"
     ... >
---


But this doesn't seem to work : (sorting by type)
---
<tree id="treeClass"
     ...
     sortResource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
     sortDirection="ascending"
     ... >
---

By the way this sorts by label : (sorting by type, and by label as
second criteria) :
---
<tree id="treeClass"
     ...
     sortResource="http://www.w3.org/2000/01/rdf-schema#label"
     sortResource2="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
     sortDirection="ascending"
     ... >
---


Is there any way to sort my ressources by type ?

My interpretation is that the 'type' predicates leads to a RDF resource
that isn't a RDF Literal. Following this concideration, I would need to
sort resources by the 'label' of the 'type', but to my knowledge, it is
not possible to "chain" predicates in these declarations...

Do you have solutions ? Any solutions modifying the RDF to achieve the
goal cannot be concidered as good solutions (my source RDF is the
standard W3C RDF schema definition).

Thanks for any help on this topic.

I'm moving towards HEAD builds to look at new sort code on templates...

Valentin LAB
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf
Reply | Threaded
Open this post in threaded view
|

Re: Template sorting on the w3 rdf-syntax 'type' predicate

Neil-4
Valentin LAB wrote:

> My interpretation is that the 'type' predicates leads to a RDF
> resource that isn't a RDF Literal. Following this concideration, I
> would need to sort resources by the 'label' of the 'type', but to my
> knowledge, it is not possible to "chain" predicates in these
> declarations...

I don't know if it applies to your particular issue but my understanding
was that extended templates can chain predicates.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf
Reply | Threaded
Open this post in threaded view
|

Re: Template sorting on the w3 rdf-syntax 'type' predicate

Valentin LAB
Neil a écrit :

> Valentin LAB wrote:
>
>> My interpretation is that the 'type' predicates leads to a RDF
>> resource that isn't a RDF Literal. Following this concideration, I
>> would need to sort resources by the 'label' of the 'type', but to my
>> knowledge, it is not possible to "chain" predicates in these
>> declarations...
>
> I don't know if it applies to your particular issue but my understanding
> was that extended templates can chain predicates.
>

well yes, templates can chain predicates in extended form (in the
conditions element). But this issue concerns sorting results, and it
doesn't seems to allow to chain predicates in the sorting condition.

A solution we could think about, is to bind a template variable "?var"
to the value targetted to be the sorting condition. In that case, it
make no problem to bind a variable (in binding element) to a predicate
"chain". But tree sort do not seem to support template variable...

According to http://wiki.mozilla.org/XUL:Template_Features_in_1.9 ,
sorting with tree should work. So I did download and compile HEAD
version, and I am playing with new functionnality... but it seems that
the new sort Service isn't used by default, and that multiple key
sorting on variables isn't really working how someone would expect after
reading the Templates feature in 1.9.

I will make a separate thread for this particular problem on 1.9's
templating problem.
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf
Reply | Threaded
Open this post in threaded view
|

Re: Template sorting on the w3 rdf-syntax 'type' predicate

Neil-4
Valentin LAB wrote:

> A solution we could think about, is to bind a template variable "?var"
> to the value targetted to be the sorting condition. In that case, it
> make no problem to bind a variable (in binding element) to a predicate
> "chain". But tree sort do not seem to support template variable...

Sure it does; the Help viewer uses it. In fact, it's also a chained
predicate, because it combines a condition with a binding to look two
levels deep into the help file's RDF structure (don't ask me why it was
structured like that though).

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf
Reply | Threaded
Open this post in threaded view
|

Re: Template sorting on the w3 rdf-syntax 'type' predicate

Valentin LAB
Neil a écrit :

> Valentin LAB wrote:
>
>> A solution we could think about, is to bind a template variable "?var"
>> to the value targetted to be the sorting condition. In that case, it
>> make no problem to bind a variable (in binding element) to a predicate
>> "chain". But tree sort do not seem to support template variable...
>
> Sure it does; the Help viewer uses it. In fact, it's also a chained
> predicate, because it combines a condition with a binding to look two
> levels deep into the help file's RDF structure (don't ask me why it was
> structured like that though).

OK, I messed myself, this works fine. (only in <treecol> element thou).

The problem I have (which is completely different) is that I have a
template which generate static content in specific cells (in the same
column), but not in other column, in which the content is dynamic
(straight out of the rdf database). I need to sort by this "static" row.

ie :

<template>

    <!-- First rule : Elements -->

    <rule>
        ...

       <action>
         <treechildren>
            <treeitem uri="?sub">
              <treerow>
                <treecell label="?label"/>
                <treecell label="Element"/>
              </treerow>
            </treeitem>
          </treechildren>
       </action>
    </rule>

    <!-- Second rule : Class -->

    <rule>
        ...

       <action>
         <treechildren>
            <treeitem uri="?sub">
              <treerow>
                <treecell label="?label"/>
                <treecell label="Class"/>
              </treerow>
            </treeitem>
          </treechildren>
       </action>
    </rule>

    <!-- Third rule : Property -->

    <rule>
        ...

       <action>

       <action>
         <treechildren>
            <treeitem uri="?sub">
              <treerow>
                <treecell label="?label"/>
                <treecell label="Property"/>
              </treerow>
            </treeitem>
          </treechildren>
       </action>

       </action>
    </rule>
<template>

This puts the strings "Element", "Class", or "Property" in the second
column for each element. I would like to display the tree with Classes
first, then Properties and then Elements.

I think the only solution is to add RDF predicates (in a in memory
DataSource, that would follow my original datasource in a
CompositeDataSource) to "tag" appropriately the database contents. This
will permit to rewrite the template in all dynamical mode, which should
ease sorting.

Is this the easiest solution ?
_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf