RDFa without using xmlns:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

RDFa without using xmlns:

Martin McEvoy
Hello all,

I have put together a page demonstrating extracting RDFa  without using
xmlns: attributes.

see: http://weborganics.co.uk/demo/rdfa.html

How it works is a little bit of json is parsed along with the page that
describes the prefix matches. The parser (Transformr) finds the json
data using an auto discovery link in the head of the page using
@rel="dataset".

see: http://weborganics.co.uk/demo/prefixes.json

The reason why I have added this feature is because it works well in
HTML, json is super easy to parse (an well supported),  some people are
not happy using xmlns: attributes so this gives them an alternative and
I think it may help decide what format @profile should maybe be in
should it ever be introduced in future versions of RDFa.

Thanks.

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Mark Birbeck-4
Hi Martin,

Good to see you making a start on this.

I too, am in favour of using JSON for at least one of the possible
formats for prefix mappings. But you seem to have two properties
everywhere that one will do. :)

(I'll explain that a bit more in a moment.)

First, the problem with using link/@rel value to point to a set of
prefix mappings is that you won't find them until you start
parsing...and by then it's too late.

One possible solution would be to use another attribute. Myself I'd
like to see us use @profile, and if the receiving server were to use
content-negotiation, then the prefix mappings could come back in any
form.

Another alternative that has been mentioned -- apologies for not
remembering who by -- is to overload the syntax of whatever attribute
is used for prefix mappings. E.g., if @prefix or @token, or whatever
is used, contained a URL with no mapping, then it would mean that it's
a reference to a document full of mappings.

Yet another approach would be to change the parsing model so that
<head> is treated specially. I did actually have this in an early
draft of RDFa, but it wasn't that popular. :) But there is something
to be said for processing the <head> first, and then using the triples
provided to set everything up for the subsequent parsing of the body.

Much as I like that model, that horse has probably flown...or whatever
the expression is.

Anyway, on to the rest of your proposal.

As I say, I'd like a JSON solution too, because that way a browser can
get at the mappings.

However, whilst you currently have this:

  {
    "namespace" : [
      {
        "prefix": "foaf",
        "value": "http://xmlns.com/foaf/0.1/"
      },
      {
        "prefix": "dc",
        "value": "http://purl.org/dc/elements/1.1/"
      }
    ]
  }

I'd suggest that all you actually need is this:

  {
    "namespace": {
      "foaf": "http://xmlns.com/foaf/0.1/",
      "dc": "http://purl.org/dc/elements/1.1/"
    }
  }

As it happens, RDFj [1] includes a way to set context information,
such as prefix-mappings and a base URL, which uses that more compact
approach:

  {
    context: {
      base: "<http://example.org/about>",
      token: {
        title: "http://xmlns.com/foaf/0.1/title",
        maker: "http://xmlns.com/foaf/0.1/maker",
        name: "http://xmlns.com/foaf/0.1/name",
        homepage: "http://xmlns.com/foaf/0.1/homepage"
      }
  }

So I'd like to suggest that we look at using this same pattern, for
the 'profile' document.

'context' is normally used like this:

  {
    context: {
      base: "<http://example.org/about>",
      token: {
        title: "http://xmlns.com/foaf/0.1/title",
        maker: "http://xmlns.com/foaf/0.1/maker",
        name: "http://xmlns.com/foaf/0.1/name",
        homepage: "http://xmlns.com/foaf/0.1/homepage"
      }
    },
    "$": "<>",
      title: "Anna's Homepage",
      maker: {
        name: "Anna Wilder",
        homepage: "<>"
      }
  }

which makes me wonder if there might be some value in allowing the
'profile' document to contain triples as well as prefix mappings.

It's not important for the moment, but it's perhaps worth revisiting
at some point.

Regards,

Mark

[1] <http://code.google.com/p/backplanejs/wiki/Rdfj>

On Mon, Dec 7, 2009 at 6:15 PM, Martin McEvoy <[hidden email]> wrote:

> Hello all,
>
> I have put together a page demonstrating extracting RDFa  without using
> xmlns: attributes.
>
> see: http://weborganics.co.uk/demo/rdfa.html
>
> How it works is a little bit of json is parsed along with the page that
> describes the prefix matches. The parser (Transformr) finds the json data
> using an auto discovery link in the head of the page using @rel="dataset".
>
> see: http://weborganics.co.uk/demo/prefixes.json
>
> The reason why I have added this feature is because it works well in HTML,
> json is super easy to parse (an well supported),  some people are not happy
> using xmlns: attributes so this gives them an alternative and I think it may
> help decide what format @profile should maybe be in should it ever be
> introduced in future versions of RDFa.
>
> Thanks.
>
> --
> Martin McEvoy
>
> WebOrganics http://weborganics.co.uk/
> Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
Mark Birbeck wrote:
> Hi Martin,
>
> Good to see you making a start on this.
>  
More thinking out loud ;)
> I too, am in favour of using JSON for at least one of the possible
> formats for prefix mappings. But you seem to have two properties
> everywhere that one will do. :)
>
> (I'll explain that a bit more in a moment.)
>  
:)
> First, the problem with using link/@rel value to point to a set of
> prefix mappings is that you won't find them until you start
> parsing...and by then it's too late.
>  
agreed, its not perfect....

> One possible solution would be to use another attribute. Myself I'd
> like to see us use @profile, and if the receiving server were to use
> content-negotiation, then the prefix mappings could come back in any
> form.
>  
Im a little unconvinced that @profile will work, its one of those things
that authors tend to forget (like in microformats)  but you never know.

Another way I tried was setting a header tag to something like

"X-Dataset:  http://...dataset.json"

It worked as a way to deliver the json to the parser before parsing
which was easy enough for parsers to Implement... but I think it may be
a little beyond what is actually practical...

> Another alternative that has been mentioned -- apologies for not
> remembering who by -- is to overload the syntax of whatever attribute
> is used for prefix mappings. E.g., if @prefix or @token, or whatever
> is used, contained a URL with no mapping, then it would mean that it's
> a reference to a document full of mappings.
>
> Yet another approach would be to change the parsing model so that
> <head> is treated specially. I did actually have this in an early
> draft of RDFa, but it wasn't that popular. :) But there is something
> to be said for processing the <head> first, and then using the triples
> provided to set everything up for the subsequent parsing of the body.
>
> Much as I like that model, that horse has probably flown...or whatever
> the expression is.
>
> Anyway, on to the rest of your proposal.
>
> As I say, I'd like a JSON solution too, because that way a browser can
> get at the mappings.
>
> However, whilst you currently have this:
>
>   {
>     "namespace" : [
>       {
>         "prefix": "foaf",
>         "value": "http://xmlns.com/foaf/0.1/"
>       },
>       {
>         "prefix": "dc",
>         "value": "http://purl.org/dc/elements/1.1/"
>       }
>     ]
>   }
>
> I'd suggest that all you actually need is this:
>
>   {
>     "namespace": {
>       "foaf": "http://xmlns.com/foaf/0.1/",
>       "dc": "http://purl.org/dc/elements/1.1/"
>     }
>   }
>
>  

I agree also, I have changed the example to what you suggested above, I
was just trying to keep it simple.. but then again yours is simpler ;)

> As it happens, RDFj [1] includes a way to set context information,
> such as prefix-mappings and a base URL, which uses that more compact
> approach:
>
>   {
>     context: {
>       base: "<http://example.org/about>",
>       token: {
>         title: "http://xmlns.com/foaf/0.1/title",
>         maker: "http://xmlns.com/foaf/0.1/maker",
>         name: "http://xmlns.com/foaf/0.1/name",
>         homepage: "http://xmlns.com/foaf/0.1/homepage"
>       }
>   }
>
> So I'd like to suggest that we look at using this same pattern, for
> the 'profile' document.
>
> 'context' is normally used like this:
>
>   {
>     context: {
>       base: "<http://example.org/about>",
>       token: {
>         title: "http://xmlns.com/foaf/0.1/title",
>         maker: "http://xmlns.com/foaf/0.1/maker",
>         name: "http://xmlns.com/foaf/0.1/name",
>         homepage: "http://xmlns.com/foaf/0.1/homepage"
>       }
>     },
>     "$": "<>",
>       title: "Anna's Homepage",
>       maker: {
>         name: "Anna Wilder",
>         homepage: "<>"
>       }
>   }
>  
and if you combine my example (+ your suggestions )  with yours .....

{
    namespace: {
      foaf: "http://xmlns.com/foaf/0.1/",
      dc: "http://purl.org/dc/elements/1.1/"
    },
    context: {
      base: "http://example.org/about",
      token: {
        title: "dc:title",
        maker: "foaf:maker",
        name: "foaf:name",
        homepage: "foaf:homepage"
      }
    }
}

much nicer ( there is nothing wrong with CURIEs in json is there),  it
is fairly easy to implement too, I've tried something very similar in a
more extended test a month or so back.
> which makes me wonder if there might be some value in allowing the
> 'profile' document to contain triples as well as prefix mappings.
>  
I don't know about that either seems excessive to me... and is probably
going to get out of sync with the current document.
> It's not important for the moment, but it's perhaps worth revisiting
> at some point.
>  

It will be good to hit the ground running when you do.

Best wishes.

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Mark Birbeck-4
Hi Martin,

> [...]
>
> and if you combine my example (+ your suggestions )  with yours .....
>
> {
>   namespace: {
>     foaf: "http://xmlns.com/foaf/0.1/",
>     dc: "http://purl.org/dc/elements/1.1/"
>   },
>   context: {
>     base: "http://example.org/about",
>     token: {
>       title: "dc:title",
>       maker: "foaf:maker",
>       name: "foaf:name",
>       homepage: "foaf:homepage"
>     }
>   }
> }
>
Oops...sorry...I haven't explained it very well.

My 'token' value is playing exactly the same role as your 'namespaces'
value. So I'm suggesting that for the JSON serialisation of prefix
mappings, we actually use RDFj.

Some justifications are:

1. We don't use the idea of namespaces in RDFa -- they are prefix
mappings. So we wouldn't want to use the term 'namespaces'.

2. The notion of a 'token' is more general than simply a prefix
mapping, as argued for in my blog post earlier in the year, on
'Tokenising the Semantic Web'.

3. Making 'token' an object within 'context' (rather than on its own),
creates the possibility of having other context information, such as a
base URL.

It's also possible to abbreviate it; a technique I have used a lot in
my RDFa library is to allow the parent of an object to omitted. So
although the general syntax is this:

  {
    context: {
      token: { ... }
    }
  }

we could easily allow this, as well:

  {
    token: { ... }
  }

4. RDFj already exists.


So, to clarify my point, your example:

  {
    namespace: {
      foaf: "http://xmlns.com/foaf/0.1/",
      dc: "http://purl.org/dc/elements/1.1/"
    }
  }

would become this, when expressed in RDFj:

  {
    context:
      token: {
        foaf: "http://xmlns.com/foaf/0.1/",
        dc: "http://purl.org/dc/elements/1.1/"
      }
    }
  }

And if we allowed the abbreviation, it could become this:

  {
    token: {
      foaf: "http://xmlns.com/foaf/0.1/",
      dc: "http://purl.org/dc/elements/1.1/"
    }
  }

Regards,

Mark

--
Mark Birbeck, webBackplane

[hidden email]

http://webBackplane.com/mark-birbeck

webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)

Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
Mark Birbeck wrote:

> Hi Martin,
>
>  
>> [...]
>>
>> and if you combine my example (+ your suggestions )  with yours .....
>>
>> {
>>   namespace: {
>>     foaf: "http://xmlns.com/foaf/0.1/",
>>     dc: "http://purl.org/dc/elements/1.1/"
>>   },
>>   context: {
>>     base: "http://example.org/about",
>>     token: {
>>       title: "dc:title",
>>       maker: "foaf:maker",
>>       name: "foaf:name",
>>       homepage: "foaf:homepage"
>>     }
>>   }
>> }
>>
>>    
> Oops...sorry...I haven't explained it very well.
>
> My 'token' value is playing exactly the same role as your 'namespaces'
> value. So I'm suggesting that for the JSON serialisation of prefix
> mappings, we actually use RDFj.
>  

All, sorry...
> Some justifications are:
>
>
>  

I agree :)
> And if we allowed the abbreviation, it could become this:
>
>   {
>     token: {
>       foaf: "http://xmlns.com/foaf/0.1/",
>       dc: "http://purl.org/dc/elements/1.1/"
>     }
>   }
>  

I have changed the example to

{
    "token": {
      "foaf": "http://xmlns.com/foaf/0.1/",
      "dc": "http://purl.org/dc/elements/1.1/"
    }
}

sorry about the quotes on everything php json decoding wont work with
out them.

Best wishes Mark and thanks for your thoughts, very valuable.

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Mark Birbeck-4
Hi Martin,

> [...]
>
> sorry about the quotes on everything php json decoding wont work with out
> them.

It's actually a very good idea to keep them in. I should really update
my examples, and do the same.

With quotes, pretty much anything will work safely. For example, the
following is valid JSON (and is what makes it attractive as an RDF
transport mechanism):

  {
    "http://xmlns.com/foaf/0.1/name": "Anna Wilder",
    "http://xmlns.com/foaf/0.1/homepage": "<http://example.org/about>"
  }

If we ensure that our examples include the quotes then people should
be safe if they cut and paste an example, and edit the contents.

Once again, thanks for taking a lead on getting some samples out there
for people to discuss.

Regards,

Mark

--
Mark Birbeck, webBackplane

[hidden email]

http://webBackplane.com/mark-birbeck

webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)

Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Toby Inkster-4
In reply to this post by Martin McEvoy
Replying to several messages in one...

On Mon, 2009-12-07 at 23:07 +0000, Martin McEvoy wrote:
> sorry about the quotes on everything php json decoding wont work with
> out them.

PHP's JSON implementation is perfectly correct to reject input where
strings have not been quoted. RFC 4627 specifies that all strings in
JSON *must* be quoted:

         string = quotation-mark *char quotation-mark

(quotation-mark is a double-quote).

Mark Birbeck wrote:
> First, the problem with using link/@rel value to point to a set of
> prefix mappings is that you won't find them until you start
> parsing...and by then it's too late.

I disagree. I think it's an elegant way of linking to the mappings
without defining much new stuff. (No new elements or attributes.) It is
no more a problem for sequential programming than processing <base href>
is, and RDFa processors already need to do that. Diving into the DOM to
pick up prefix mappings before processing the root element for RDFa
should be no more of a problem than diving in to pick up the base URI
is.

> One possible solution would be to use another attribute. Myself I'd
> like to see us use @profile, and if the receiving server were to use
> content-negotiation, then the prefix mappings could come back in any
> form.

I think using @profile would be a waste of bandwidth. It's already used
for GRDDL and XMDP profiles. An RDFa processor would probably end up
downloading a bunch of files that it doesn't have anything useful it can
do with.

> http://code.google.com/p/backplanejs/wiki/Rdfj

I'd recommend removing references to "JSON" from this page. The format
described does not seem to be serialisable to JSON (as defined by RFC
4627, or by json.org), though probably a subset of RDFj could. For
example, Javascript functions may be used as literals in RDFj, but
cannot be represented in JSON.

Martin McEvoy wrote:
> Another way I tried was setting a header tag to something like
> "X-Dataset:  http://...dataset.json"
> It worked as a way to deliver the json to the parser before parsing
> which was easy enough for parsers to Implement... but I think it may
> be a little beyond what is actually practical...

This would be useless to processors which can't see the HTTP envelope.
And if a web page were saved to disk, it would lose its headers, and
thus its semantics. Whatsmore, some publishers struggle with web server
configuration, so requiring them to send particular headers can be a big
ask. No, HTTP headers are not a good way of doing this.

That said, if they were to be used, I'd recommend using the existing
Link header (currently going through the later stages of the RFC
process), rather than minting an X-Header:

Link: </files/my_ds.json>; rel="http://weborganics.co.uk/ns/dataset"

(rel types in Link headers are URIs)

--
Toby A Inkster
<mailto:[hidden email]>
<http://tobyinkster.co.uk>


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
Toby Inkster wrote:

> Replying to several messages in one...
>
> On Mon, 2009-12-07 at 23:07 +0000, Martin McEvoy wrote:
>  
>> sorry about the quotes on everything php json decoding wont work with
>> out them.
>>    
>
> PHP's JSON implementation is perfectly correct to reject input where
> strings have not been quoted. RFC 4627 specifies that all strings in
> JSON *must* be quoted:
>
>          string = quotation-mark *char quotation-mark
>
> (quotation-mark is a double-quote).
>  

I agree ;)

> Mark Birbeck wrote:
>  
>> First, the problem with using link/@rel value to point to a set of
>> prefix mappings is that you won't find them until you start
>> parsing...and by then it's too late.
>>    
>
> I disagree. I think it's an elegant way of linking to the mappings
> without defining much new stuff. (No new elements or attributes.) It is
> no more a problem for sequential programming than processing <base href>
> is, and RDFa processors already need to do that. Diving into the DOM to
> pick up prefix mappings before processing the root element for RDFa
> should be no more of a problem than diving in to pick up the base URI
> is.
>
>  
>> One possible solution would be to use another attribute. Myself I'd
>> like to see us use @profile, and if the receiving server were to use
>> content-negotiation, then the prefix mappings could come back in any
>> form.
>>    
>
> I think using @profile would be a waste of bandwidth. It's already used
> for GRDDL and XMDP profiles. An RDFa processor would probably end up
> downloading a bunch of files that it doesn't have anything useful it can
> do with.
>
>  
>> http://code.google.com/p/backplanejs/wiki/Rdfj
>>    
>
> I'd recommend removing references to "JSON" from this page. The format
> described does not seem to be serialisable to JSON (as defined by RFC
> 4627, or by json.org), though probably a subset of RDFj could. For
> example, Javascript functions may be used as literals in RDFj, but
> cannot be represented in JSON.
>  

Oh I don't know this seems to be valid json ....

{
    "context": {
        "token": {
            "name": "http://xmlns.com/foaf/0.1/name",
            "homepage": "http://xmlns.com/foaf/0.1/homepage"
        },
        "name": "Anna Wilder",
        "homepage": "<http://example.org/about>"
    }
}

as does this....

{
    "token": {
        "foaf": "http://xmlns.com/foaf/0.1/",
        "dc": "http://purl.org/dc/elements/1.1/"
    }
}

Mark mentioned that the page needs to be updated to use quotes ;)

try validating the examples above here: http://www.jsonlint.com/

> Martin McEvoy wrote:
>  
>> Another way I tried was setting a header tag to something like
>> "X-Dataset:  http://...dataset.json"
>> It worked as a way to deliver the json to the parser before parsing
>> which was easy enough for parsers to Implement... but I think it may
>> be a little beyond what is actually practical...
>>    
>
> This would be useless to processors which can't see the HTTP envelope.
> And if a web page were saved to disk, it would lose its headers, and
> thus its semantics. Whatsmore, some publishers struggle with web server
> configuration, so requiring them to send particular headers can be a big
> ask. No, HTTP headers are not a good way of doing this.
>  

I strongly Agree with you Toby, its nice to eliminate things that
*definitely* wont work  ;)
> That said, if they were to be used, I'd recommend using the existing
> Link header (currently going through the later stages of the RFC
> process), rather than minting an X-Header:
>
> Link: </files/my_ds.json>; rel="http://weborganics.co.uk/ns/dataset"
>
> (rel types in Link headers are URIs)
>
>  

I like Link headers  ;)  ....

In my Apache htaccess file I can add something like ...

Header set Link: </files/my_ds.json>
;rel=http://weborganics.co.uk/ns/dataset

which is easy enough for implementers.

Thanks Toby

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Toby Inkster-4
On Tue, 2009-12-08 at 11:15 +0000, Martin McEvoy wrote:
> Mark mentioned that the page needs to be updated to use quotes ;)

I was thinking more of this example:

{
  /* bnode */
    "a": "<http://www.w3.org/2004/09/fresnel#Format>",
    "http://www.w3.org/2004/09/fresnel#group": "<http://ubiquity-rdfa.googlecode.com/svn/trunk/_samples/formats/debug.html>",
    "http://ubiquity-rdfa.googlecode.com/action": function(obj) {
      .
      .
      .
      return;
    }
}

Including Javascript functions is a non-trivial extension of JSON,
enough to make the data unparsable by virtually any JSON library, and
(even if parsed OK) useless outside of environments that can evaluate
Javascript.

--
Toby A Inkster
<mailto:[hidden email]>
<http://tobyinkster.co.uk>


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
Hello Toby...

Toby Inkster wrote:

> On Tue, 2009-12-08 at 11:15 +0000, Martin McEvoy wrote:
>  
>> Mark mentioned that the page needs to be updated to use quotes ;)
>>    
>
> I was thinking more of this example:
>
> {
>   /* bnode */
>     "a": "<http://www.w3.org/2004/09/fresnel#Format>",
>     "http://www.w3.org/2004/09/fresnel#group": "<http://ubiquity-rdfa.googlecode.com/svn/trunk/_samples/formats/debug.html>",
>     "http://ubiquity-rdfa.googlecode.com/action": function(obj) {
>       .
>       .
>       .
>       return;
>     }
> }
>
> Including Javascript functions is a non-trivial extension of JSON,
> enough to make the data unparsable by virtually any JSON library, and
> (even if parsed OK) useless outside of environments that can evaluate
> Javascript.
>  

Ok how about using arrays ?

{
    "context": [
        {
            "token": [
                {
                    "name": "http://xmlns.com/foaf/0.1/name",
                    "homepage": "http://xmlns.com/foaf/0.1/homepage"
                },
                {
                    "name": "Anna Wilder",
                    "homepage": "<http://example.org/about>"
                }
            ]
        }
    ]
}

Would that improve anything ?... or have I missed the point .... ( which
I am guessing I may have )

Thanks...


--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
Martin McEvoy wrote:

> Hello Toby...
>
> Toby Inkster wrote:
>> On Tue, 2009-12-08 at 11:15 +0000, Martin McEvoy wrote:
>>  
>>> Mark mentioned that the page needs to be updated to use quotes ;)
>>>    
>>
>> I was thinking more of this example:
>>
>> {
>>   /* bnode */
>>     "a": "<http://www.w3.org/2004/09/fresnel#Format>",
>>     "http://www.w3.org/2004/09/fresnel#group":
>> "<http://ubiquity-rdfa.googlecode.com/svn/trunk/_samples/formats/debug.html>",
>>
>>     "http://ubiquity-rdfa.googlecode.com/action": function(obj) {
>>       .
>>       .
>>       .
>>       return;
>>     }
>> }
>>
>> Including Javascript functions is a non-trivial extension of JSON,
>> enough to make the data unparsable by virtually any JSON library, and
>> (even if parsed OK) useless outside of environments that can evaluate
>> Javascript.
>>  
>
> Ok how about using arrays ?
>
....

>
> Would that improve anything ?... or have I missed the point .... (
> which I am guessing I may have )

I did, sorry Toby my fault for rushing out this morning, ;)

The json example you provided above seems to be invalid json, (unquoted
strings, not key => value pairs ) so I am a little at a loss at what you
are attempting to do, so I will guess here is how I would represent your
example in json and you tell me what I am missing....

{ "obj" :
    {
    "a": "<http://www.w3.org/2004/09/fresnel#Format>",
    "http://www.w3.org/2004/09/fresnel#group":
"<http://ubiquity-rdfa.googlecode.com/svn/trunk/_samples/formats/debug.html>"
  },
    "http://ubiquity-rdfa.googlecode.com/action": {
                "function(obj)":"return"
        }

}

?...

Thanks.


--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Toby Inkster-4
On Tue, 2009-12-08 at 14:59 +0000, Martin McEvoy wrote:
> The json example you provided above seems to be invalid json,
> (unquoted strings, not key => value pairs ) so I am a little at a loss
> at what you are attempting to do, so I will guess here is how I would
> represent your example in json and you tell me what I am missing....

That's rather my point. The example I posted (which was a quote from the
RDFj wiki page on Google Code) *cannot* be represented in JSON because
JSON doesn't have a data type equivalent to Javascript's first-class
function objects.

Thus RDFj is not JSON - it's Javascript. (Or rather, it uses a format
that's a subset of Javascript but a superset of JSON.)

--
Toby A Inkster
<mailto:[hidden email]>
<http://tobyinkster.co.uk>


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
Toby Inkster wrote:

> On Tue, 2009-12-08 at 14:59 +0000, Martin McEvoy wrote:
>  
>> The json example you provided above seems to be invalid json,
>> (unquoted strings, not key => value pairs ) so I am a little at a loss
>> at what you are attempting to do, so I will guess here is how I would
>> represent your example in json and you tell me what I am missing....
>>    
>
> That's rather my point. The example I posted (which was a quote from the
> RDFj wiki page on Google Code) *cannot* be represented in JSON because
> JSON doesn't have a data type equivalent to Javascript's first-class
> function objects.
>
> Thus RDFj is not JSON - it's Javascript. (Or rather, it uses a format
> that's a subset of Javascript but a superset of JSON.)
>  

Ahh, I see Agreed.


thanks Toby ;)

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
In reply to this post by Martin McEvoy
Martin McEvoy wrote:

> Mark Birbeck wrote:
>
>>
>>
>> 'context' is normally used like this:
>>
>>   {
>>     context: {
>>       base: "<http://example.org/about>",
>>       token: {
>>         title: "http://xmlns.com/foaf/0.1/title",
>>         maker: "http://xmlns.com/foaf/0.1/maker",
>>         name: "http://xmlns.com/foaf/0.1/name",
>>         homepage: "http://xmlns.com/foaf/0.1/homepage"
>>       }
>>     },
>>     "$": "<>",
>>       title: "Anna's Homepage",
>>       maker: {
>>         name: "Anna Wilder",
>>         homepage: "<>"
>>       }
>>   }
>>  
...

>  I've tried something very similar in a more extended test a month or
> so back.

I have put all the extended tests that I did at that time here:

http://weborganics.co.uk/dataset/

Please dont pay much attention to the format of the JSON, its clumsy,
have a look more at the results of your "tokenizing the web" idea, all
the examples use microformats and HTML5 by the way


Best wishes.

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/


Reply | Threaded
Open this post in threaded view
|

Re: RDFa without using xmlns:

Martin McEvoy
In reply to this post by Mark Birbeck-4
Hello Mark,

Mark Birbeck wrote:
> .... thanks for taking a lead on getting some samples out there
> for people to discuss.
>  
Just an update.

the demo has changed to no namespace scoping  (xmlns:) an no prefixes
(prefix:) just tokens .

please see: http://weborganics.co.uk/demo/rdfa.html


Best wishes.

--
Martin McEvoy

WebOrganics http://weborganics.co.uk/
Add to address book: http://transformr.co.uk/hcard/http://weborganics.co.uk/