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

getURL vs MSXML

Expand Messages
  • annoyingmouse2001
    Hi there, I ll beg your forgiveness now as this will be a long post... I m using MSXML to parse an OWL ontology and use some really ugly script to pull out the
    Message 1 of 4 , Jun 30, 2004
    • 0 Attachment
      Hi there,

      I'll beg your forgiveness now as this will be a long post...

      I'm using MSXML to parse an OWL ontology and use some really ugly
      script to pull out the data that I want and I was wondering if there
      was a better way of doing it while keeping the structure of the
      original document the same? I've looked at getURL but that doesn't
      seem to be well documented. I want to grab the data from the XML
      based OWL file and convert the pertinent stuff into a number of
      arrays. This is a sample of the XML based OWL file:

      <?xml version="1.0"?>
      <rdf:RDF xmlns="http://a.com/ontology#"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
      xmlns:owl="http://www.w3.org/2002/07/owl#"
      xml:base="http://a.com/ontology">
      <owl:Ontology rdf:about=""/>
      <owl:Class rdf:ID="employee"/>
      <owl:ObjectProperty rdf:ID="superior">
      <rdfs:comment>Employee's superior</rdfs:comment>
      <rdfs:domain rdf:resource="#employee"/>
      <rdf:type
      rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
      </owl:ObjectProperty>
      <owl:DatatypeProperty rdf:ID="details">
      <rdfs:domain rdf:resource="#employee"/>
      <rdf:type
      rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
      <rdfs:range
      rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
      <rdfs:comment>Contact details of employee</rdfs:comment>
      </owl:DatatypeProperty>
      <owl:DatatypeProperty rdf:ID="title">
      <rdfs:range
      rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
      <rdfs:domain rdf:resource="#employee"/>
      <rdfs:comment>Title of employee</rdfs:comment>
      <rdf:type
      rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
      </owl:DatatypeProperty>
      <owl:FunctionalProperty rdf:ID="name">
      <rdfs:comment>Name of the employee</rdfs:comment>
      <rdf:type
      rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
      <rdfs:domain rdf:resource="#employee"/>
      <rdfs:label xml:lang="en">Contact details</rdfs:label>
      <rdfs:range
      rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
      </owl:FunctionalProperty>
      <employee rdf:ID="H_Wards_and_Day_Service_Manager">
      <name>Erik Straker</name>
      <details>01223 604031</details>
      <superior rdf:resource="#Area_Director_Huntingdon"/>
      <title>Wards and Day Service Manager</title>
      </employee>
      <employee rdf:ID="Area_Director_Huntingdon">
      <details>01223 601298</details>
      <superior rdf:resource="#Chief_Executive"/>
      <name>Jessie Post</name>
      <title>Area Director Huntingdon</title>
      </employee>
      <employee rdf:ID="Chief_Executive">
      <details>01223 602600</details>
      <title>Chief Executive</title>
      <name>Eve Grindstaff</name>
      <superior rdf:resource="#Chairman"/>
      </employee>
      </rdf:RDF>
      <!-- Created with Protege (with OWL Plugin 1.0, Build 72)
      http://protege.stanford.edu -->

      This would give me 5 arrays, thus:
      Array1
      ("H_Wards_and_Day_Service_Manager","Area_Director_Huntingdon","Chief_
      Executive");
      Array2("Erik Straker","Jessie Post","Eve Grindstaff"),
      Array3("01223 604031","01223 601298","01223 602600"),
      Array4("#Area_Director_Huntingdon","#Chief_Executive","#Chairman"),
      Array5("Wards and Day Service Manager","Area Director
      Huntingdon","Chief Executive"),

      I've done this using MSXML but I'm sure that there is a better way
      of doing without relying on proprietary software solutions as I'd
      like to be able to view using Mozilla with the adobe plugin. I
      appreciate that getURL might also be proprietry but can't really
      think of a way of doing it otherwise. I've looked at XML for Script
      but that doesn't support what I want either. Further I'd like to be
      able to have a scroll bar along the side of the resulting image as
      it does become quite long when there are lots of employees but don't
      really know how to do that either. I have seen the example on the
      adobe site but wasn't sure if it was possible to alter the height
      attribute of an svg using code…?

      Any help would be greatly appreciated.

      Yours sincerely,

      Dom
    • Doug Schepers
      Hi, Dom- getURL is definitely the way for you to go. It started out as an Adobe innovation, but was adopted by Batik (and the late great Corel plugin as well,
      Message 2 of 4 , Jun 30, 2004
      • 0 Attachment
        Hi, Dom-

        getURL is definitely the way for you to go. It started out as an Adobe
        innovation, but was adopted by Batik (and the late great Corel plugin as
        well, IIRC), and is being formalized in SVG1.2. It should work on any
        platform that ASV works on.

        Once you receive the data in your callback, you can simply use parseXML and
        insert the result into a metadata element in the SVG (to make sure there are
        you memeory leaks, which can be a problem), then create your arrays with
        standard DOM calls and looping, using getElementByTagName to find,
        respectively, the 'employee' (att: 'id'), 'name' 'details', and 'title'.
        It's very simple, and for such a small dataset (up to a few dozen rows),
        it's plenty fast.

        If you search the archives of this list, you will find several working
        examples of using getURL in just this way. A caveat: parseXML works
        differently in ASV3 and ASV6; be mindful how you use it.

        There are lots of scrollbar implementations out there. There is one in the
        files section of SVG-Dvelopers by the wizard of SVG, Peter Sorotokin, that
        should work for you.

        Regards-
        -Doug

        annoyingmouse2001 wrote:
        |
        | Hi there,
        |
        | I'll beg your forgiveness now as this will be a long post...
        |
        | I'm using MSXML to parse an OWL ontology and use some really
        | ugly script to pull out the data that I want and I was
        | wondering if there was a better way of doing it while keeping
        | the structure of the original document the same? I've looked
        | at getURL but that doesn't seem to be well documented. I want
        | to grab the data from the XML based OWL file and convert the
        | pertinent stuff into a number of arrays. This is a sample of
        | the XML based OWL file:
        |
        | <?xml version="1.0"?>
        | <rdf:RDF xmlns="http://a.com/ontology#"
        | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        | xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
        | xmlns:owl="http://www.w3.org/2002/07/owl#"
        | xml:base="http://a.com/ontology">
        | <owl:Ontology rdf:about=""/>
        | <owl:Class rdf:ID="employee"/>
        | <owl:ObjectProperty rdf:ID="superior">
        | <rdfs:comment>Employee's superior</rdfs:comment>
        | <rdfs:domain rdf:resource="#employee"/>
        | <rdf:type
        | rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
        | </owl:ObjectProperty>
        | <owl:DatatypeProperty rdf:ID="details">
        | <rdfs:domain rdf:resource="#employee"/>
        | <rdf:type
        | rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
        | <rdfs:range
        | rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
        | <rdfs:comment>Contact details of employee</rdfs:comment>
        | </owl:DatatypeProperty>
        | <owl:DatatypeProperty rdf:ID="title">
        | <rdfs:range
        | rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
        | <rdfs:domain rdf:resource="#employee"/>
        | <rdfs:comment>Title of employee</rdfs:comment>
        | <rdf:type
        | rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
        | </owl:DatatypeProperty>
        | <owl:FunctionalProperty rdf:ID="name">
        | <rdfs:comment>Name of the employee</rdfs:comment>
        | <rdf:type
        | rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
        | <rdfs:domain rdf:resource="#employee"/>
        | <rdfs:label xml:lang="en">Contact details</rdfs:label>
        | <rdfs:range
        | rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
        | </owl:FunctionalProperty>
        | <employee rdf:ID="H_Wards_and_Day_Service_Manager">
        | <name>Erik Straker</name>
        | <details>01223 604031</details>
        | <superior rdf:resource="#Area_Director_Huntingdon"/>
        | <title>Wards and Day Service Manager</title>
        | </employee>
        | <employee rdf:ID="Area_Director_Huntingdon">
        | <details>01223 601298</details>
        | <superior rdf:resource="#Chief_Executive"/>
        | <name>Jessie Post</name>
        | <title>Area Director Huntingdon</title>
        | </employee>
        | <employee rdf:ID="Chief_Executive">
        | <details>01223 602600</details>
        | <title>Chief Executive</title>
        | <name>Eve Grindstaff</name>
        | <superior rdf:resource="#Chairman"/>
        | </employee>
        | </rdf:RDF>
        | <!-- Created with Protege (with OWL Plugin 1.0, Build 72)
        | http://protege.stanford.edu -->
        |
        | This would give me 5 arrays, thus:
        | Array1
        | ("H_Wards_and_Day_Service_Manager","Area_Director_Huntingdon","Chief_
        | Executive");
        | Array2("Erik Straker","Jessie Post","Eve Grindstaff"),
        | Array3("01223 604031","01223 601298","01223 602600"),
        | Array4("#Area_Director_Huntingdon","#Chief_Executive","#Chairman"),
        | Array5("Wards and Day Service Manager","Area Director
        | Huntingdon","Chief Executive"),
        |
        | I've done this using MSXML but I'm sure that there is a
        | better way of doing without relying on proprietary software
        | solutions as I'd like to be able to view using Mozilla with
        | the adobe plugin. I appreciate that getURL might also be
        | proprietry but can't really think of a way of doing it
        | otherwise. I've looked at XML for Script but that doesn't
        | support what I want either. Further I'd like to be able to
        | have a scroll bar along the side of the resulting image as it
        | does become quite long when there are lots of employees but
        | don't really know how to do that either. I have seen the
        | example on the adobe site but wasn't sure if it was possible
        | to alter the height attribute of an svg using code…?
        |
        | Any help would be greatly appreciated.
        |
        | Yours sincerely,
        |
        | Dom
        |
        |
        |
        |
        |
        | ------------------------ Yahoo! Groups Sponsor
        | --------------------~--> Make a clean sweep of pop-up ads.
        | Yahoo! Companion Toolbar.
        | Now with Pop-Up Blocker. Get it for free!
        | http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/1U_rlB/TM
        | --------------------------------------------------------------
        | ------~->
        |
        | -----
        | To unsubscribe send a message to:
        | svg-developers-unsubscribe@yahoogroups.com
        | -or-
        | visit http://groups.yahoo.com/group/svg-developers and click
        | "edit my membership"
        | ----
        | Yahoo! Groups Links
        |
        |
        |
        |
        |
        | ---
        | Incoming mail is certified Virus Free.
        | Checked by AVG anti-virus system (http://www.grisoft.com).
        | Version: 6.0.700 / Virus Database: 457 - Release Date: 6/6/2004
        |
        |

        ---
        Outgoing mail is certified Virus Free.
        Checked by AVG anti-virus system (http://www.grisoft.com).
        Version: 6.0.700 / Virus Database: 457 - Release Date: 6/6/2004
      • Jim Ley
        ... parseXML is the relevant bit, and in fact once you ve parsed it the rest of your code will likely work without change. http://jibbering.com/rdf-parser/ is
        Message 3 of 4 , Jul 1 2:04 AM
        • 0 Attachment
          annoyingmouse2001 <annoyingmouse2001 <at> yahoo.co.uk> writes:

          > I'm using MSXML to parse an OWL ontology and use some really ugly
          > script to pull out the data that I want and I was wondering if there
          > was a better way of doing it while keeping the structure of the
          > original document the same?

          parseXML is the relevant bit, and in fact once you've parsed it the rest of your
          code will likely work without change.

          http://jibbering.com/rdf-parser/ is my attempt at an RDF parser in javascript
          which works in ASV, you can view the code (there's a commented version knocking
          about) and hopefully see how to parse your OWL.

          Cheers,

          Jim.
        • annoyingmouse2001
          Cheers Jim, thanks for getting back to me, I ll hacve a look at your script but in the meantime is parseXML a part of the adobe plugin? Thamls again, Dom ...
          Message 4 of 4 , Jul 1 10:20 AM
          • 0 Attachment
            Cheers Jim,

            thanks for getting back to me, I'll hacve a look at your script but
            in the meantime is parseXML a part of the adobe plugin?

            Thamls again,

            Dom

            --- In svg-developers@yahoogroups.com, Jim Ley <jim@j...> wrote:
            > annoyingmouse2001 <annoyingmouse2001 <at> yahoo.co.uk> writes:
            >
            > > I'm using MSXML to parse an OWL ontology and use some really
            ugly
            > > script to pull out the data that I want and I was wondering if
            there
            > > was a better way of doing it while keeping the structure of the
            > > original document the same?
            >
            > parseXML is the relevant bit, and in fact once you've parsed it
            the rest of your
            > code will likely work without change.
            >
            > http://jibbering.com/rdf-parser/ is my attempt at an RDF parser
            in javascript
            > which works in ASV, you can view the code (there's a commented
            version knocking
            > about) and hopefully see how to parse your OWL.
            >
            > Cheers,
            >
            > Jim.
          Your message has been successfully submitted and would be delivered to recipients shortly.