Semantic Web using Magritte

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

Semantic Web using Magritte

YossiDM
I was wondering if anyone tried to do any kind of XML mapping using  
Magritte. I have the requirement to generate RDF from my business  
objects, so I was thinking of ways to simplify this. My idea was to  
add something in the Magritte descriptions for each object that  
pointed to the appropriate URI and schema.

This may be more trouble than its worth. I suppose anyone who has done  
anything with generating XML from Magritte could maybe provide some  
insight on any hurdles they faced, design ideas, etc.

I also am looking at Magritte for simplifying XML serialization in  
general. My problem overall is that I have to generate all these  
formats (XML for web service, RSS, ATOM, RDF) and I do not want to  
have to write a complex parser to even do this 1/2 way dynamically.  
Are there any other libraries out there that do this already? For  
instance, I did notice that there is that library (name escapes me)  
that lets you port your objects between Smalltalk versions by dumping  
to XML files, so that is somewhat close to what I need to do.

I am thinking since I already have a large number of Magritte  
descriptions, I might as well expand upon that. This will also let me  
do things like change a schema dynamically and provide easy access  
memento objects to do things like create a preview of whatever format  
I am trying to produce. Thoughts?



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Philippe Marschall
Hi

For audioscrobbler I did the opposite, from given XML to Magritte:
http://source.lukas-renggli.ch/audioscrobbler.html
The audioscrobbler xml is quite gay and I was surprised when I got it
working. It is also used for feed parsing of the Seaside homepage.

Cheers
Philippe

2007/12/5, [hidden email] <[hidden email]>:

> I was wondering if anyone tried to do any kind of XML mapping using
> Magritte. I have the requirement to generate RDF from my business
> objects, so I was thinking of ways to simplify this. My idea was to
> add something in the Magritte descriptions for each object that
> pointed to the appropriate URI and schema.
>
> This may be more trouble than its worth. I suppose anyone who has done
> anything with generating XML from Magritte could maybe provide some
> insight on any hurdles they faced, design ideas, etc.
>
> I also am looking at Magritte for simplifying XML serialization in
> general. My problem overall is that I have to generate all these
> formats (XML for web service, RSS, ATOM, RDF) and I do not want to
> have to write a complex parser to even do this 1/2 way dynamically.
> Are there any other libraries out there that do this already? For
> instance, I did notice that there is that library (name escapes me)
> that lets you port your objects between Smalltalk versions by dumping
> to XML files, so that is somewhat close to what I need to do.
>
> I am thinking since I already have a large number of Magritte
> descriptions, I might as well expand upon that. This will also let me
> do things like change a schema dynamically and provide easy access
> memento objects to do things like create a preview of whatever format
> I am trying to produce. Thoughts?
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

YossiDM
Thanks for the input, I had definitely considered that. I was even  
looking at XSLT but I really like keeping everything in Smalltalk. I  
do indeed need to go many directions since there are many entry points  
and services with this application. I also have explored creating new  
canvases and doing some things with Readers/Writers like in Pier.

I would do exactly what your describing, but I still am left with the  
problem of generating good output from my objects. So for example,  
sticking with music, say we have an Album object. I have all kinds of  
stuff already for Magritte in there for this object. Now I want to do  
something like in my seaside control provide an RDF button that when  
clicked, generates the RDF output. I would need to traverse the entire  
object/description graph and output the RDF with the album name,  
title, etc. and the track listing, and then artist info, etc. It  
definitely would suck without the metadata to identify which RDF URI  
corresponds with each object in the graph.

Essentially, I am thinking of creating a simpler  
serializer/deserializer driven by Magritte descriptions similar to  
what I've done before in .NET and Java. I am just not sure if that is  
very Smalltalk like as I like to always think there is a better way  
than resorting to what I have done in those languages :)

For instance, there is a JSON serializer in .NET where I can say  
Album.ToJSON(), or the XML serializer Album.ToXML(). It so happens  
that depending on the serializer/deserializer, it will read attributes  
I put on my class like [XmlIgnore]. That stuff is really primitive I  
think compared to what I can do in Magritte.

I guess I am trying to prevent a future meltdown because as this  
application is developed, I am going to have to start going back and  
forth with lots of web services to communicate with Java and Flash in  
particular. I want to set a good example on the Smalltalk side by  
generating everything automagically.

Quoting Philippe Marschall <[hidden email]>:

> Hi
>
> For audioscrobbler I did the opposite, from given XML to Magritte:
> http://source.lukas-renggli.ch/audioscrobbler.html
> The audioscrobbler xml is quite gay and I was surprised when I got it
> working. It is also used for feed parsing of the Seaside homepage.
>
> Cheers
> Philippe
>
> 2007/12/5, [hidden email] <[hidden email]>:
>> I was wondering if anyone tried to do any kind of XML mapping using
>> Magritte. I have the requirement to generate RDF from my business
>> objects, so I was thinking of ways to simplify this. My idea was to
>> add something in the Magritte descriptions for each object that
>> pointed to the appropriate URI and schema.
>>
>> This may be more trouble than its worth. I suppose anyone who has done
>> anything with generating XML from Magritte could maybe provide some
>> insight on any hurdles they faced, design ideas, etc.
>>
>> I also am looking at Magritte for simplifying XML serialization in
>> general. My problem overall is that I have to generate all these
>> formats (XML for web service, RSS, ATOM, RDF) and I do not want to
>> have to write a complex parser to even do this 1/2 way dynamically.
>> Are there any other libraries out there that do this already? For
>> instance, I did notice that there is that library (name escapes me)
>> that lets you port your objects between Smalltalk versions by dumping
>> to XML files, so that is somewhat close to what I need to do.
>>
>> I am thinking since I already have a large number of Magritte
>> descriptions, I might as well expand upon that. This will also let me
>> do things like change a schema dynamically and provide easy access
>> memento objects to do things like create a preview of whatever format
>> I am trying to produce. Thoughts?
>>
>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>





_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Jason Johnson-5
Are your descriptions going to still be relevant for PDF in the same
way they are for a web page?  Magritte descriptions usually provide a
GUI for entering or editing them, no?

If the descriptions do fit (or if they don't you could make new ones)
then I think the thing to do would be to add a renderer.  Right now
there is one for Seaside and one for Morphic.  So you would need one
for each format you need to output to.  Perhaps there is already a
package that does something like Seaside's canvas for XML (maybe XANO
or whatever it's called?).


On Dec 5, 2007 3:33 PM,  <[hidden email]> wrote:

> Thanks for the input, I had definitely considered that. I was even
> looking at XSLT but I really like keeping everything in Smalltalk. I
> do indeed need to go many directions since there are many entry points
> and services with this application. I also have explored creating new
> canvases and doing some things with Readers/Writers like in Pier.
>
> I would do exactly what your describing, but I still am left with the
> problem of generating good output from my objects. So for example,
> sticking with music, say we have an Album object. I have all kinds of
> stuff already for Magritte in there for this object. Now I want to do
> something like in my seaside control provide an RDF button that when
> clicked, generates the RDF output. I would need to traverse the entire
> object/description graph and output the RDF with the album name,
> title, etc. and the track listing, and then artist info, etc. It
> definitely would suck without the metadata to identify which RDF URI
> corresponds with each object in the graph.
>
> Essentially, I am thinking of creating a simpler
> serializer/deserializer driven by Magritte descriptions similar to
> what I've done before in .NET and Java. I am just not sure if that is
> very Smalltalk like as I like to always think there is a better way
> than resorting to what I have done in those languages :)
>
> For instance, there is a JSON serializer in .NET where I can say
> Album.ToJSON(), or the XML serializer Album.ToXML(). It so happens
> that depending on the serializer/deserializer, it will read attributes
> I put on my class like [XmlIgnore]. That stuff is really primitive I
> think compared to what I can do in Magritte.
>
> I guess I am trying to prevent a future meltdown because as this
> application is developed, I am going to have to start going back and
> forth with lots of web services to communicate with Java and Flash in
> particular. I want to set a good example on the Smalltalk side by
> generating everything automagically.
>
>
> Quoting Philippe Marschall <[hidden email]>:
>
> > Hi
> >
> > For audioscrobbler I did the opposite, from given XML to Magritte:
> > http://source.lukas-renggli.ch/audioscrobbler.html
> > The audioscrobbler xml is quite gay and I was surprised when I got it
> > working. It is also used for feed parsing of the Seaside homepage.
> >
> > Cheers
> > Philippe
> >
> > 2007/12/5, [hidden email] <[hidden email]>:
> >> I was wondering if anyone tried to do any kind of XML mapping using
> >> Magritte. I have the requirement to generate RDF from my business
> >> objects, so I was thinking of ways to simplify this. My idea was to
> >> add something in the Magritte descriptions for each object that
> >> pointed to the appropriate URI and schema.
> >>
> >> This may be more trouble than its worth. I suppose anyone who has done
> >> anything with generating XML from Magritte could maybe provide some
> >> insight on any hurdles they faced, design ideas, etc.
> >>
> >> I also am looking at Magritte for simplifying XML serialization in
> >> general. My problem overall is that I have to generate all these
> >> formats (XML for web service, RSS, ATOM, RDF) and I do not want to
> >> have to write a complex parser to even do this 1/2 way dynamically.
> >> Are there any other libraries out there that do this already? For
> >> instance, I did notice that there is that library (name escapes me)
> >> that lets you port your objects between Smalltalk versions by dumping
> >> to XML files, so that is somewhat close to what I need to do.
> >>
> >> I am thinking since I already have a large number of Magritte
> >> descriptions, I might as well expand upon that. This will also let me
> >> do things like change a schema dynamically and provide easy access
> >> memento objects to do things like create a preview of whatever format
> >> I am trying to produce. Thoughts?
> >>
> >>
> >>
> >> _______________________________________________
> >> SmallWiki, Magritte, Pier and Related Tools ...
> >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
> >>
> >
> > _______________________________________________
> > SmallWiki, Magritte, Pier and Related Tools ...
> > https://www.iam.unibe.ch/mailman/listinfo/smallwiki
> >
>
>
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Lukas Renggli-2
> Are your descriptions going to still be relevant for PDF in the same
> way they are for a web page?  Magritte descriptions usually provide a
> GUI for entering or editing them, no?

This is one part, but not all ...

- Introspection
- Reflection
- Documentation
- Viewer building
- Editor building
- Report building
- Data validation
- Query processing
- String parsing
- Object persistency
- Object indexing
- Object setup
- Object verification
- Object adaption
- Object customization

The (incomplete) list is from my Magritte tutorial slides.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Matthias Berth-2
In reply to this post by YossiDM
Just by analogy: did you have a look at the way PierBlog creates the
RSS feed for the blog? Seems to be a similar problem...

-- Matthias

On Dec 5, 2007 3:33 PM,  <[hidden email]> wrote:

> Thanks for the input, I had definitely considered that. I was even
> looking at XSLT but I really like keeping everything in Smalltalk. I
> do indeed need to go many directions since there are many entry points
> and services with this application. I also have explored creating new
> canvases and doing some things with Readers/Writers like in Pier.
>
> I would do exactly what your describing, but I still am left with the
> problem of generating good output from my objects. So for example,
> sticking with music, say we have an Album object. I have all kinds of
> stuff already for Magritte in there for this object. Now I want to do
> something like in my seaside control provide an RDF button that when
> clicked, generates the RDF output. I would need to traverse the entire
> object/description graph and output the RDF with the album name,
> title, etc. and the track listing, and then artist info, etc. It
> definitely would suck without the metadata to identify which RDF URI
> corresponds with each object in the graph.
>
> Essentially, I am thinking of creating a simpler
> serializer/deserializer driven by Magritte descriptions similar to
> what I've done before in .NET and Java. I am just not sure if that is
> very Smalltalk like as I like to always think there is a better way
> than resorting to what I have done in those languages :)
>
> For instance, there is a JSON serializer in .NET where I can say
> Album.ToJSON(), or the XML serializer Album.ToXML(). It so happens
> that depending on the serializer/deserializer, it will read attributes
> I put on my class like [XmlIgnore]. That stuff is really primitive I
> think compared to what I can do in Magritte.
>
> I guess I am trying to prevent a future meltdown because as this
> application is developed, I am going to have to start going back and
> forth with lots of web services to communicate with Java and Flash in
> particular. I want to set a good example on the Smalltalk side by
> generating everything automagically.
>
>
> Quoting Philippe Marschall <[hidden email]>:
>
> > Hi
> >
> > For audioscrobbler I did the opposite, from given XML to Magritte:
> > http://source.lukas-renggli.ch/audioscrobbler.html
> > The audioscrobbler xml is quite gay and I was surprised when I got it
> > working. It is also used for feed parsing of the Seaside homepage.
> >
> > Cheers
> > Philippe
> >
> > 2007/12/5, [hidden email] <[hidden email]>:
> >> I was wondering if anyone tried to do any kind of XML mapping using
> >> Magritte. I have the requirement to generate RDF from my business
> >> objects, so I was thinking of ways to simplify this. My idea was to
> >> add something in the Magritte descriptions for each object that
> >> pointed to the appropriate URI and schema.
> >>
> >> This may be more trouble than its worth. I suppose anyone who has done
> >> anything with generating XML from Magritte could maybe provide some
> >> insight on any hurdles they faced, design ideas, etc.
> >>
> >> I also am looking at Magritte for simplifying XML serialization in
> >> general. My problem overall is that I have to generate all these
> >> formats (XML for web service, RSS, ATOM, RDF) and I do not want to
> >> have to write a complex parser to even do this 1/2 way dynamically.
> >> Are there any other libraries out there that do this already? For
> >> instance, I did notice that there is that library (name escapes me)
> >> that lets you port your objects between Smalltalk versions by dumping
> >> to XML files, so that is somewhat close to what I need to do.
> >>
> >> I am thinking since I already have a large number of Magritte
> >> descriptions, I might as well expand upon that. This will also let me
> >> do things like change a schema dynamically and provide easy access
> >> memento objects to do things like create a preview of whatever format
> >> I am trying to produce. Thoughts?
> >>
> >>
> >>
> >> _______________________________________________
> >> SmallWiki, Magritte, Pier and Related Tools ...
> >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
> >>
> >
> > _______________________________________________
> > SmallWiki, Magritte, Pier and Related Tools ...
> > https://www.iam.unibe.ch/mailman/listinfo/smallwiki
> >
>
>
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Lukas Renggli-2
> Just by analogy: did you have a look at the way PierBlog creates the
> RSS feed for the blog? Seems to be a similar problem...

It doesn't really use the descriptions to generate the blog items, it  
could (or better it should) though.

Lukas

>
>
> -- Matthias
>
> On Dec 5, 2007 3:33 PM,  <[hidden email]> wrote:
>> Thanks for the input, I had definitely considered that. I was even
>> looking at XSLT but I really like keeping everything in Smalltalk. I
>> do indeed need to go many directions since there are many entry  
>> points
>> and services with this application. I also have explored creating new
>> canvases and doing some things with Readers/Writers like in Pier.
>>
>> I would do exactly what your describing, but I still am left with the
>> problem of generating good output from my objects. So for example,
>> sticking with music, say we have an Album object. I have all kinds of
>> stuff already for Magritte in there for this object. Now I want to do
>> something like in my seaside control provide an RDF button that when
>> clicked, generates the RDF output. I would need to traverse the  
>> entire
>> object/description graph and output the RDF with the album name,
>> title, etc. and the track listing, and then artist info, etc. It
>> definitely would suck without the metadata to identify which RDF URI
>> corresponds with each object in the graph.
>>
>> Essentially, I am thinking of creating a simpler
>> serializer/deserializer driven by Magritte descriptions similar to
>> what I've done before in .NET and Java. I am just not sure if that is
>> very Smalltalk like as I like to always think there is a better way
>> than resorting to what I have done in those languages :)
>>
>> For instance, there is a JSON serializer in .NET where I can say
>> Album.ToJSON(), or the XML serializer Album.ToXML(). It so happens
>> that depending on the serializer/deserializer, it will read  
>> attributes
>> I put on my class like [XmlIgnore]. That stuff is really primitive I
>> think compared to what I can do in Magritte.
>>
>> I guess I am trying to prevent a future meltdown because as this
>> application is developed, I am going to have to start going back and
>> forth with lots of web services to communicate with Java and Flash in
>> particular. I want to set a good example on the Smalltalk side by
>> generating everything automagically.
>>
>>
>> Quoting Philippe Marschall <[hidden email]>:
>>
>>> Hi
>>>
>>> For audioscrobbler I did the opposite, from given XML to Magritte:
>>> http://source.lukas-renggli.ch/audioscrobbler.html
>>> The audioscrobbler xml is quite gay and I was surprised when I got  
>>> it
>>> working. It is also used for feed parsing of the Seaside homepage.
>>>
>>> Cheers
>>> Philippe
>>>
>>> 2007/12/5, [hidden email] <[hidden email]>:
>>>> I was wondering if anyone tried to do any kind of XML mapping using
>>>> Magritte. I have the requirement to generate RDF from my business
>>>> objects, so I was thinking of ways to simplify this. My idea was to
>>>> add something in the Magritte descriptions for each object that
>>>> pointed to the appropriate URI and schema.
>>>>
>>>> This may be more trouble than its worth. I suppose anyone who has  
>>>> done
>>>> anything with generating XML from Magritte could maybe provide some
>>>> insight on any hurdles they faced, design ideas, etc.
>>>>
>>>> I also am looking at Magritte for simplifying XML serialization in
>>>> general. My problem overall is that I have to generate all these
>>>> formats (XML for web service, RSS, ATOM, RDF) and I do not want to
>>>> have to write a complex parser to even do this 1/2 way dynamically.
>>>> Are there any other libraries out there that do this already? For
>>>> instance, I did notice that there is that library (name escapes me)
>>>> that lets you port your objects between Smalltalk versions by  
>>>> dumping
>>>> to XML files, so that is somewhat close to what I need to do.
>>>>
>>>> I am thinking since I already have a large number of Magritte
>>>> descriptions, I might as well expand upon that. This will also  
>>>> let me
>>>> do things like change a schema dynamically and provide easy access
>>>> memento objects to do things like create a preview of whatever  
>>>> format
>>>> I am trying to produce. Thoughts?
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> SmallWiki, Magritte, Pier and Related Tools ...
>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>>
>>>
>>> _______________________________________________
>>> SmallWiki, Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

YossiDM
Yes, I looked at that too which is one of the reasons I am asking for  
best practices/guidance/feasibility. I was wondering if there was some  
reason why Pier didn't use the descriptions like that as Lukas  
mentioned.

The thing about RDF is that it involves creating ontologies.  
Everything is derived from concepts and such. Depending on the other  
things you use like n-tuples, you end up with "is a" and "has a"  
relationships. I thought the notion of 1-many, 1-1, etc. in Magritte  
might be an interesting way to map to this. I have so many domain  
objects, I really need my ontologies to be consistent and not go all  
over the place pointing at random schemas because another developer  
didn't know I already defined "what is an album" in RDF.

Anyway, I've got a lot of other things to bang out first, so for now  
the best I'm going to produce is some proofs of concept. At some  
point, if anything I do is worth sharing, I'll put it up on  
squeaksource or somewhere else.

Quoting Lukas Renggli <[hidden email]>:

>> Just by analogy: did you have a look at the way PierBlog creates the
>> RSS feed for the blog? Seems to be a similar problem...
>
> It doesn't really use the descriptions to generate the blog items, it
> could (or better it should) though.
>
> Lukas
>
>>
>>
>> -- Matthias
>>
>> On Dec 5, 2007 3:33 PM,  <[hidden email]> wrote:
>>> Thanks for the input, I had definitely considered that. I was even
>>> looking at XSLT but I really like keeping everything in Smalltalk. I
>>> do indeed need to go many directions since there are many entry
>>> points
>>> and services with this application. I also have explored creating new
>>> canvases and doing some things with Readers/Writers like in Pier.
>>>
>>> I would do exactly what your describing, but I still am left with the
>>> problem of generating good output from my objects. So for example,
>>> sticking with music, say we have an Album object. I have all kinds of
>>> stuff already for Magritte in there for this object. Now I want to do
>>> something like in my seaside control provide an RDF button that when
>>> clicked, generates the RDF output. I would need to traverse the
>>> entire
>>> object/description graph and output the RDF with the album name,
>>> title, etc. and the track listing, and then artist info, etc. It
>>> definitely would suck without the metadata to identify which RDF URI
>>> corresponds with each object in the graph.
>>>
>>> Essentially, I am thinking of creating a simpler
>>> serializer/deserializer driven by Magritte descriptions similar to
>>> what I've done before in .NET and Java. I am just not sure if that is
>>> very Smalltalk like as I like to always think there is a better way
>>> than resorting to what I have done in those languages :)
>>>
>>> For instance, there is a JSON serializer in .NET where I can say
>>> Album.ToJSON(), or the XML serializer Album.ToXML(). It so happens
>>> that depending on the serializer/deserializer, it will read
>>> attributes
>>> I put on my class like [XmlIgnore]. That stuff is really primitive I
>>> think compared to what I can do in Magritte.
>>>
>>> I guess I am trying to prevent a future meltdown because as this
>>> application is developed, I am going to have to start going back and
>>> forth with lots of web services to communicate with Java and Flash in
>>> particular. I want to set a good example on the Smalltalk side by
>>> generating everything automagically.
>>>
>>>
>>> Quoting Philippe Marschall <[hidden email]>:
>>>
>>>> Hi
>>>>
>>>> For audioscrobbler I did the opposite, from given XML to Magritte:
>>>> http://source.lukas-renggli.ch/audioscrobbler.html
>>>> The audioscrobbler xml is quite gay and I was surprised when I got
>>>> it
>>>> working. It is also used for feed parsing of the Seaside homepage.
>>>>
>>>> Cheers
>>>> Philippe
>>>>
>>>> 2007/12/5, [hidden email] <[hidden email]>:
>>>>> I was wondering if anyone tried to do any kind of XML mapping using
>>>>> Magritte. I have the requirement to generate RDF from my business
>>>>> objects, so I was thinking of ways to simplify this. My idea was to
>>>>> add something in the Magritte descriptions for each object that
>>>>> pointed to the appropriate URI and schema.
>>>>>
>>>>> This may be more trouble than its worth. I suppose anyone who has
>>>>> done
>>>>> anything with generating XML from Magritte could maybe provide some
>>>>> insight on any hurdles they faced, design ideas, etc.
>>>>>
>>>>> I also am looking at Magritte for simplifying XML serialization in
>>>>> general. My problem overall is that I have to generate all these
>>>>> formats (XML for web service, RSS, ATOM, RDF) and I do not want to
>>>>> have to write a complex parser to even do this 1/2 way dynamically.
>>>>> Are there any other libraries out there that do this already? For
>>>>> instance, I did notice that there is that library (name escapes me)
>>>>> that lets you port your objects between Smalltalk versions by
>>>>> dumping
>>>>> to XML files, so that is somewhat close to what I need to do.
>>>>>
>>>>> I am thinking since I already have a large number of Magritte
>>>>> descriptions, I might as well expand upon that. This will also
>>>>> let me
>>>>> do things like change a schema dynamically and provide easy access
>>>>> memento objects to do things like create a preview of whatever
>>>>> format
>>>>> I am trying to produce. Thoughts?
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> SmallWiki, Magritte, Pier and Related Tools ...
>>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>>>
>>>>
>>>> _______________________________________________
>>>> SmallWiki, Magritte, Pier and Related Tools ...
>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> SmallWiki, Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>





_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

YossiDM
In reply to this post by Jason Johnson-5
Quoting Jason Johnson <[hidden email]>:

> Are your descriptions going to still be relevant for PDF in the same
> way they are for a web page?  Magritte descriptions usually provide a
> GUI for entering or editing them, no?

Not sure if we're talking about the same things totally. My  
descriptions have little if anything to do with the GUI. I am looking  
at adding automagic form generation in a few places, but mainly the  
forms in my application are hand-crafted right now. We do use Magritte  
in conjunction with our forms (ex: memento validation), just not to  
generate the actual form UI.


> If the descriptions do fit (or if they don't you could make new ones)
> then I think the thing to do would be to add a renderer.  Right now
> there is one for Seaside and one for Morphic.  So you would need one
> for each format you need to output to.  Perhaps there is already a
> package that does something like Seaside's canvas for XML (maybe XANO
> or whatever it's called?).
>

I have explored this strategy before for output. The thing is I really  
need to produce the RDF/XML/FOAF/RSS/ATOM or whatever else is required  
given a particular use case on demand relevant to the context. Many  
situations, Seaside won't play much of a part if any, however Magritte  
and my back-end (eventually Gemstone) will. There are many channels  
already to the application, so I want to define how to provide data in  
each format once regardless of the channel.



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Lukas Renggli-2
>> Are your descriptions going to still be relevant for PDF in the same
>> way they are for a web page?  Magritte descriptions usually provide a
>> GUI for entering or editing them, no?
>
> Not sure if we're talking about the same things totally. My
> descriptions have little if anything to do with the GUI. I am looking
> at adding automagic form generation in a few places, but mainly the
> forms in my application are hand-crafted right now. We do use Magritte
> in conjunction with our forms (ex: memento validation), just not to
> generate the actual form UI.

It is easy to generate dumps of described objects to specific output  
formats. It is almost too simple to show a text exporter here:

   aModel description do: [ :desc |
     aStream
       nextPutAll: (desc label);
       nextPutAll: ’: ’;
       nextPutAll: (desc toString: (desc accessor readFrom: aModel));
cr ]

For a description of this example see page 6 in http://www.iam.unibe.ch/~scg/Archive/Papers/Reng07aMagritte.pdf 
.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

Jason Johnson-5
In reply to this post by YossiDM
On Dec 6, 2007 2:33 PM,  <[hidden email]> wrote:
>
> I have explored this strategy before for output. The thing is I really
> need to produce the RDF/XML/FOAF/RSS/ATOM or whatever else is required
> given a particular use case on demand relevant to the context. Many
> situations, Seaside won't play much of a part if any, however Magritte
> and my back-end (eventually Gemstone) will. There are many channels
> already to the application, so I want to define how to provide data in
> each format once regardless of the channel.

I don't think I expressed myself clearly.  Magritte is (as I
understand it) a way to provide extra meta "descriptions" of how your
objects might be presented.  Other components can take these
components and turn them into some representation.  For example, the
Seaside Magritte renderer takes these descriptions and makes HTML.

You could create e.g. a PDF renderer that reads these descriptions and
generates a PDF item from them.  I know that would be a lot of work,
but once it's done one time we all have it.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

YossiDM
In reply to this post by Lukas Renggli-2
Thanks Lukas, that is what I am doing now for our exports to text  
files as well as some custom XML to send to specific web services.  
Basically, we just wrote a writer that visits the object hierarchy in  
the way we want and calls the appropriate visit methods. This is  
similar to some things I have seen in Pier.

I am less worried about that part as I am the design of my actual  
descriptions and how easy it will be to read/write into these formats  
without writing too much manual stuff. In other words, I don't want to  
write separate ways of handling different kinds of objects, I want  
descriptions that fit all the object types I have.

As far as I have tested, this is relatively simple. It's just in my  
experience going down these roads, you write about 90% then comes an  
uh-oh moment if you are not careful. I am most interested in how  
others have done similar things as well as affirmation of my ideas.

In any case, glad to hear that it is certainly possible/practical.



Quoting Lukas Renggli <[hidden email]>:

>>> Are your descriptions going to still be relevant for PDF in the same
>>> way they are for a web page?  Magritte descriptions usually provide a
>>> GUI for entering or editing them, no?
>>
>> Not sure if we're talking about the same things totally. My
>> descriptions have little if anything to do with the GUI. I am looking
>> at adding automagic form generation in a few places, but mainly the
>> forms in my application are hand-crafted right now. We do use Magritte
>> in conjunction with our forms (ex: memento validation), just not to
>> generate the actual form UI.
>
> It is easy to generate dumps of described objects to specific output
> formats. It is almost too simple to show a text exporter here:
>
>    aModel description do: [ :desc |
>      aStream
>        nextPutAll: (desc label);
>        nextPutAll: ’: ’;
>        nextPutAll: (desc toString: (desc accessor readFrom: aModel));
> cr ]
>
> For a description of this example see page 6 in  
> http://www.iam.unibe.ch/~scg/Archive/Papers/Reng07aMagritte.pdf
> .
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>





_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Semantic Web using Magritte

YossiDM
In reply to this post by Jason Johnson-5
Agreed, you are definitely correct.

I think depending on implementation it would be specific to what you  
are doing. For instance if we're visiting different domain objects and  
their descriptions to create the PDF, we might have certain kinds of  
objects to represent the output we want.

Additionally, you are mentioning one use for Magritte. Lukas mentioned  
some others in one of his posts. Magritte to me is simply a good  
implementation of meta-programming constructs I have used in other  
languages such as .NET, Java, Lisp, Ruby, C++, etc.  For instance,  
.NET has reflection and attributes which allows for some similar  
constructs as Magritte, but definitely not as flexible. Previously, I  
used .NET attributes to create a simple Object to RDF converter.  
Obviously though I'd rather work with Smalltalk :)

Output formats is just one goal for me, another one is searching my  
object graph, for example as done in Pier. Ramon's implementation of  
Magritte to generate Glorp descriptions is another.

I'd be happy to share anything that I produce regarding conversions. I  
brought some of this up because after exploring what I could find in  
Squeak for RDF in particular, it was frustrating. I did not want have  
to do things like create anything cased out or with specialized extra  
objects. I wanted to just use my existing objects and extend them in a  
way that didn't interfere with what I was already doing. Since my  
Magritte descriptions are already there and exist on the meta level,  
it's a good choice I think.

Quoting Jason Johnson <[hidden email]>:

> I don't think I expressed myself clearly.  Magritte is (as I
> understand it) a way to provide extra meta "descriptions" of how your
> objects might be presented.  Other components can take these
> components and turn them into some representation.  For example, the
> Seaside Magritte renderer takes these descriptions and makes HTML.
>
> You could create e.g. a PDF renderer that reads these descriptions and
> generates a PDF item from them.  I know that would be a lot of work,
> but once it's done one time we all have it.
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>





_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki