Loading ...
Sorry, an error occurred while loading the content.

Re: Syndication model convergence and RDF (Modified by Henry Story)

Expand Messages
  • Henry Story
    ... I have been developing something a lot better (for java programmers) than an ontology editor that may be of interest to java syndication people, and also
    Message 1 of 2 , Feb 1, 2005
    View Source
    • 0 Attachment
      On 31 Jan 2005, at 19:00, patrick chanezon wrote:
      > Thanks for the excellent post Danny.
      >
      > I mostly agree.
      > See
      > http://blogs.sun.com/roller/page/pat/
      > 20050131#re_syndication_model_convergence_and
      > with more details.
      >
      > Henry, time to fire up your ontology editor again:-)


      I have been developing something a lot better (for java programmers)
      than an ontology editor that may be of interest to java syndication
      people, and also confirm Danny's RDF bespectacled way of looking at
      things...

      I am working on writing RDF in java! :-) I have written a library and
      it is really cool. [1]

      Here is what an Atom Entry ontology looks like:

      -------------
      -8<---------------------------------------------------------
      public interface AtomEntry {
      String BASE =
      "http://bblfish.net/work/atom-owl/2005-01-03/Atom.owl#";
      String RDF_TYPE = BASE+"Entry";

      String RDF_author = BASE + "author";
      void setAuthor(AtomPerson person);
      AtomPerson getAuthor();

      /**
      * An entry can have any number of contributors
      */
      String RDF_contributor = BASE + "contributor";
      AtomPerson addContributor(AtomPerson person);
      Collection getAllContributor();

      /**
      * An entry has a title.
      * This should be a subclass of content that only takes
      * as types "text","text/html" and "text/xhtml"
      * I need to figure out how I could specify this from java.
      */
      String RDF_title = BASE + "title";
      AtomContent setTitle(AtomContent title);
      AtomContent getTitle();

      /**
      * An entry can have a summary.
      * see note about RDF_title
      */
      String RDF_summary = BASE + "summary";
      AtomContent setSummary(AtomContent summary);
      AtomContent getSummary();

      /**
      * An atom entry only has one content object
      */
      String RDF_content = BASE + "content";
      AtomContent setContent(AtomContent content);
      AtomContent getContent();

      /**
      * the date this entry was updated.
      * with many entries having the same entryid,
      * this can be thought of as the creation date of this entry
      instance.
      */
      String RDF_creation = BASE + "updated";
      void setCreation(Date creationdate);
      Date getCreation();

      /**
      * The publication date of this Entry
      */
      String RDF_published = BASE + "published";
      void setPublished(Date publicationDate);
      Date getPublished();

      /**
      * A collection of entries are identified as being versions
      * of the same entry, by virtue of
      * each one of them having the same entry id.
      */
      String RDF_id = BASE + "id";
      AtomEntryID setId(AtomEntryID id);
      AtomEntryID getId();

      /**
      * link associated with the entry
      */
      String RDF_link = BASE + "link";
      void setLink(URI link);
      URI getLink();

      /**
      * an illustration associated with this entry
      */
      String RDF_illustration =
      "http://finabetterdomain.com/ontology/#illustration";
      void setIllustration(FoafImage illustration);
      FoafImage getIllustration();


      String RDF_ruleEvent = "-"+ACLRuleChangeEvent.RDF_object;
      void addRuleEvent(ACLRuleChangeEvent evnt);
      List getAllRuleEvent();

      }
      ------------------8<------------------------------------------------

      Essentially by writing your java classes in an extended form of java
      beans (a j2se 1.5 version could use annotations) you can specify
      the url of a class, and the url of each relationship. Notice
      for example that the RDF_ruleEvent is preceeded by a "-" which
      I use to indicate that the addRuleEvent is the inverse
      of the ACLRuleChangeEvent.RDF_object relation.

      This is just the beginning. It would be great to be able to also
      specify which properties are inverse functional, which ones allow
      relations to be removed, etc. But it is really clear how this can
      work.

      In any case it is really easy to use:

      ------------------8<------------------------------------------------
      AtomPerson hjs = (AtomPerson) factory.createObject(AtomPerson.class);
      hjs.setName("Henry Story");
      hjs.setEmail("henry.story@...");
      AtomEntry header = (AtomEntry) factory.createObject(AtomEntry.class);
      header.setAuthor(hjs);
      header.setTitle(new AContent("A Unit Test Blog"));
      header.setSummary(new AContent("The best way to develop quickly is to
      develop flexibly with unit tests"));
      ------------------8<------------------------------------------------

      I have really simplified my coding of BlogEd by using this library.

      One thing is that hopefully I won't need to keep firing up an ontology
      editor as I will be able to use my java interfaces to create the xml
      description of the ontology I am coding.

      But also because everything I write is stored in an RDF database, I can
      pretty much store any data from any of the RSS formats in existence in
      the
      database, and wait until later to create objects that know how to
      interact
      with them. Perhaps if I found the ontologies I could also create
      classes on
      the fly to interact with them...

      I am not sure it is necessary to map every format to one ontology
      either.
      RDF databases incorporate inference machines, so one could allow the
      inference
      engines to infer the additional facts entailed by one format for
      another, if
      one felt confident in the mapping. In the case of the MetaWeblog API
      for example
      I am thinking of creating a clearly separate model [2]. As I need to
      post things
      to Roller which has a lot more limited functionality that what BlogEd
      offers -
      or will offer - I find it easier to model what is on the remote server
      and
      make the mapping between that model and the bloged atom model clear in
      rdf manner:
      namely by an arrow.


      This does lead me to one question. I am just about to write the
      interfaces for
      the metaweblog api. Does anyone allready have a good model for that?

      Henry Story

      [1] I was inspired initially by Hibernate to look for something like
      this, then found
      that the http://rdfreactor.ontoware.org/. But I found the
      interaction with them
      a little slow so I wrote my own library.

      https://bloged.dev.java.net/source/browse/bloged/src/com/sun/labs/
      tools/rdf/
      (I think there is enough interesting material here for a JCR)
      [2] http://groups-beta.google.com/group/atom-owl/msg/266c570c0d37b9fa
    Your message has been successfully submitted and would be delivered to recipients shortly.