Re: Is it a semantic problem?

Hi Danny and Everyone else,

My question was about how to group certain items in order to create a
relation. For example:

If we have many descriptions and many titles for certain resource,
what is the best way of finding which title relates to which
description? Usually RDF is nothing more but a collection of
statements.

I found out that the best way of doing this is to group the items into
blank nodes. For example:

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:news="http://purl.org/rss/1.0/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>

        <rdf:Description rdf:about="http://url.com">
                <news:item rdf:parseType="Resource">
                        <news:title>Some title Here</news:title>
                        <news:description>This is fun</news:description>
                </news:item>
        </rdf:Description>

</rdf:RDF>

The code above says that the resource http://url.com is described by a
news item with a news title of "Some title Here" and a news
description of "This is fun".

It is important to know that RDF is a language designed around
statements; it is not XML. The best way to write RDF is to construct
the statements first and then serialize them as XML or N3.

This was a very important lesson for me.

There is something more that I would like to mention. The way we write
RDF is very important. It is important to understand that there is a
big difference between these RDF/XML diagrams:

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:news="http://purl.org/rss/1.0/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>

        <rdf:Description rdf:about="http://url.com">
                <news:item rdf:parseType="Resource">
                        <news:title>Some title Here</news:title>
                        <news:description>This is fun</news:description>
                </news:item>
        </rdf:Description>

</rdf:RDF>

--------------------

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:news="http://purl.org/rss/1.0/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>

        <rdf:Description rdf:about="http://url.com">
                  <news:title>Some title Here</news:title>
                  <news:description>This is fun</news:description>
        </rdf:Description>

</rdf:RDF>

Both of them require different types of queries although the
statements above can be considered the same. I believe that this is a
huge problem.

I am not able to extract all the titles unless I run two queries:

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:news="http://purl.org/rss/1.0/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>

        <rdf:Description rdf:about="http://url.com">
                <news:item rdf:parseType="Resource">
                        <news:title>Some title Here</news:title>
                        <news:description>This is fun</news:description>
                </news:item>
        </rdf:Description>

        <rdf:Description rdf:about="http://url.com">
                <news:title>Second Title Here</news:title>
                <news:description>More fun for everyone</news:description>
        </rdf:Description>

</rdf:RDF>

The first statement specifies that there is a news item with a news
title and a news description, while the second statement directly
specifies the news title and the news description without
encapsulating the statements into a news item.

For us it is the same, although for machines it is completely
different. This means that the level of expression depends on the
purpose of the application which is processing the data.

How do you feel about it?


On 6/20/05, Danny Ayers <danny.ayers@gmail.com> wrote:
> On 6/19/05, Petko Petkov <p.d.petkov@gmail.com> wrote:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <rdf:RDF
> >         xmlns="http://purl.org/rss/1.0/"
> >         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> >         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
> >         xmlns:dc="http://purl.org/dc/elements/1.1/"
> > >
> >
> >         <rdf:Description rdf:about="http://url.com">
> >                 <item rdf:parseType="Resource">
> >                         <title>Some title Here</title>
> >                         <description>This is fun</description>
> >                 </item>
> >         </rdf:Description>
> >
> > </rdf:RDF>
> 
> dc:item?
> Could be mistaken, I vaguely remember an item around DC somewhere,
> unlikely it's a class, but definitely not at
> http://purl.org/dc/elements/1.1/
> 
> So how about:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <rdf:RDF
>        xmlns="http://purl.org/rss/1.0/"
>        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> >
> 
> <item rdf:about="http://url.com">
>     <title>Some title Here</title>
>     <description>This is fun</description>
> </item>
> 
> </rdf:RDF>
> 
> 
> Cheers,
> Danny.
> 
> --
> 
> http://dannyayers.com
>

Received on Monday, 20 June 2005 13:03:42 UTC