OK, I've been playing with this all day to no avail.

Going back to my <Environment> example, I have tried using the
following 2 xml string as input to ConvertXMLtoRDF:

<Environment name="test"><hasLatitudeDegrees>50</hasLatitudeDegrees></
Environment>
....and...
<Environment hasLatitudeDegrees="50"></Environment>

I'm not sure which one is correct, but neither worked.  Again, my end
goal is to be able to run the following query and get back
(<Environment>, 50).

SELECT ?subject ?val
WHERE {
    ?subject a :Environment .
        ?subject :hasLatitudeDegrees ?val .
}

Currently, when I use either of the 2 xml strings above as input to
ConvertXMLtoRDF, a (<Environment hasLatitudeDegrees="50">, rdf:type,
Environment)  triple is properly created.  I believe this is because I
added sxml:element="Environment" to the annotations of my Environment
class.

My problem is that I cannot seem to create the hasLatitudeDegrees
triple as a type :hasLatitudeDegrees.  I also cannot get the importer
to create the association of the new Environment with the new
hasLatitudeDegrees instance.

Where exactly do I need to add sxml:element or sxml:attribute
annotations?  The Environment class?  hasLatitudeDegrees
datatypeProperty?  What should their values be?  Strings?  Or class
references?  (I have added sxml:element and sxml:attribute to the
Environment and hasLatitudeDegrees property, and tried every possible
combination of moving them around as well).

How do I get the importer to use hasLatitudeDegrees as a predicate
instead of a subject or object?  Currenlty, the Environment and
hasLatitudeDegrees triples are related by a composite:child
predicate.

If there is an example of this anywhere, I would greatly appreciate
it.  The documentation was helpful, but it did not explain how to
create a parent class with a child relation containing a give value.


Thanks,

Kevin



On Oct 1, 5:14 pm, Holger Knublauch <[email protected]> wrote:
> Kevin,
>
> the sxml properties need to be set in the RDF/OWL model, not the XML.  
> As I said, please look at the RDF that the SXML importer will create:  
> you will see that the resulting classes and properties have those  
> properties on them. You can simulate the same on your pre-existing  
> classes.
>
> Holger
>
> On Oct 1, 2009, at 1:53 PM, Kevin Matthews wrote:
>
>
>
> > So, my previous XML should be:
>
> > <Environment><hasLatitudeDegrees sxml:attribute>50</
> > hasLatitudeDegrees></Environment>
> > or
> > <Environment><hasLatitudeDegrees sxml:element>50</
> > hasLatitudeDegrees></
> > Environment>
>
> > Neither of those xml string resulted in a hasLatitudeDegrees triple.
> > They still generate hasLatitudeDegrees-Environment triples.
>
> > Kev
>
> > On Oct 1, 4:29 pm, Holger Knublauch <[email protected]> wrote:
> >> If you want Semantic XML to re-use your existing classes and
> >> properties, then you need to "annotate" those classes with
> >> sxml:attribute and sxml:element values. In order to see which triples
> >> are needed, open your XML file in TBC-ME (using Semantic XML- double
> >> click on the .xml should do it), and analyze the resulting ontology.
> >> The generated classes should have sxml:element values on them, and  
> >> the
> >> importer will try to re-use existing classes if they already have
> >> those tags.
>
> >> Holger
>
> >> On Oct 1, 2009, at 1:23 PM, Kevin Matthews wrote:
>
> >>> OK, I've been playing with ConvertXMLToRDF and it seems that it may
> >>> solve my problem.  However, in the example video and blog post you
> >>> pointed me toward, it shows how to convert XML to a new ontology.  
> >>> My
> >>> goal is to convert XML into an existing ontology.
>
> >>> For example, I have an Environment class, which has a
> >>> "hasLatitudeDegrees" property.  I tried handing ConvertXMLToRDF  
> >>> these
> >>> two XML strings:
>
> >>> <Environment><hasLatitudeDegrees>50</hasLatitudeDegrees></
> >>> Environment>
> >>> ...as well as....
> >>> <Environment hasLatitudeDegrees="50"></Environment>
>
> >>> Both of these inputs resulted in a Environment instance triple
> >>> (<Environment hasLatitudeDegrees="50">, rdf:type, Environment).
> >>> However, the hasLatitudeDegrees triple was misnamed (<Environment
> >>> hasLatitudeDegrees="50">, hasLatitudeDegrees-Environment, 50).  I  
> >>> need
> >>> the triple to be (<Environment hasLatitudeDegrees="50">,
> >>> hasLatitudeDegrees, 50).
>
> >>> How do I control the names of the properties?  Can I restructure my
> >>> XML to achieve this?
>
> >>> Thanks,
>
> >>> Kev
>
> >>> On Oct 1, 11:35 am, "Irene Polikoff" <[email protected]> wrote:
> >>>> Kevin,
>
> >>>> You can read about Semantic XML 
> >>>> herehttp://composing-the-semantic-web.blogspot.com/2007/11/xmap-mapping-a
> >>>> ...
> >>>> y-xml-documents-to.html and also in Help > TopBraid Composer >
> >>>> Import and
> >>>> Export
> >>>> Creating, Importing, Querying, Saving XML documents with Semantic
> >>>> XML.
>
> >>>> If you had an XML file in the workspace, sml:ImportRDFFromWorkspace
> >>>> would
> >>>> automatically convert it into RDF. Other than that, you would need
> >>>> to use
> >>>> sml:ConvertXMLToRDF module. Once you are in RDF, you can execute
> >>>> SPARQL.
>
> >>>> The rest of your questions are better answered by Holger, but I
> >>>> don't think
> >>>> there is any XML involved in the Eclipse GUI. It works entirely
> >>>> with RDF.
>
> >>>> There is XML interface between TBE and TBL Server. It is optimized
> >>>> for TBE
> >>>> which has a client side RDF store and query engine. To use this
> >>>> interface, I
> >>>> believe you would need to develop using TBL Flex SDK.
>
> >>>> Regards,
>
> >>>> Irene
>
> >>>> -----Original Message-----
> >>>> From: [email protected]
>
> >>>> [mailto:[email protected]] On Behalf Of  
> >>>> Kevin
> >>>> Matthews
> >>>> Sent: Thursday, October 01, 2009 11:12 AM
> >>>> To: TopBraid Composer Users
> >>>> Subject: [tbc-users] Re: Webservice to Create Ontology Class
> >>>> Instances?
>
> >>>> What I meant by "what is the GUI of Eclipse calling" is this.  
> >>>> When I
> >>>> look at the Eclipse GUI, I can add a new instance of any ontology
> >>>> class to the ontology by filling in all of its values and clicking
> >>>> save.  What is TBC using to take those values and create triples  
> >>>> out
> >>>> of them and store them?  I am trying to do the same exact
> >>>> functionality, only using a web front end.  I have a web page where
> >>>> you can select an ontology class, fill in its values, and click  
> >>>> save.
> >>>> I'm sending that information in XML format to a SparqlMotion  
> >>>> script,
> >>>> that must figure out what type of class it represents and save it  
> >>>> to
> >>>> the ontology.  I was hoping that there was an easy way to do this
> >>>> without tons of BindByXPath and ApplyConstruct modules.
>
> >>>> I will happily look into SemanticXML and ConvertXMLtoRDF.  Do you
> >>>> know
> >>>> where I can find some documentation on the exact XML structure/
> >>>> schema
> >>>> I need to hand ConvertXMLtoRDF?   A quick google search did not
> >>>> return
> >>>> much relevant information.
>
> >>>> Thanks,
>
> >>>> Kevin
>
> >>>> On Sep 30, 6:59 pm, Scott Henninger <[email protected]>
> >>>> wrote:
> >>>>> Kevin;  On the below:
>
> >>>>> <Otherwise, what is the GUI of Eclipse calling to do
> >>>>>  this?  What is Topbraid Ensemble calling to do the same?>
>
> >>>>> Are you referring to parsing RDF/XML files?  This is performed by
> >>>>> TBC
> >>>>> - specifically the Jena RDF parser.  sml:ImportRDFFrom... modules
> >>>>> will
> >>>>> do this.
>
> >>>>> -- Scott
>
> >>>>> On Sep 30, 5:29 pm, Holger Knublauch <[email protected]>  
> >>>>> wrote:
>
> >>>>>> Hi Kevin,
>
> >>>>>> have you looked at Semantic XML, as supported by
> >>>>>> sml:ConvertXMLToRDF?
> >>>>>> This will take any XML instance document and turn it into a  
> >>>>>> simple
> >>>>>> ontology with classes such as widget and name, and values for the
> >>>>>> attributes and nested text elements.
>
> >>>>>> I am not sure why you are referring to Eclipse UI and TBE here?
>
> >>>>>> Regards,
> >>>>>> Holger
>
> >>>>>> On Sep 30, 2009, at 9:34 AM, Kevin Matthews wrote:
>
> >>>>>>> I am trying to write a SparqlMotion web service that takes in  
> >>>>>>> XML,
> >>>>>>> representing an instance of a class in my ontology, and stores
> >>>>>>> that
> >>>>>>> instance in the onotology.  For instance:
>
> >>>>>>> <widget>
> >>>>>>>    <name>my widget</name>
> >>>>>>>    <hasSprockets>3</hasSprockets>
> >>>>>>> </widget>
>
> >>>>>>> This input would produce a :Widget instance with a :hasSprockets
> >>>>>>> value
> >>>>>>> of 3 and an instance :name of "my widget".
>
> >>>>>>> It dawned on me while writing a complex SparqlMotion script
> >>>>>>> composed
> >>>>>>> of BindByXPath, ApplyConstruct, and IterateOverXPath modules  
> >>>>>>> that
> >>>>>>> there must be an web service that already provides this
> >>>>>>> functionality.  Otherwise, what is the GUI of Eclipse calling to
> >>>>>>> do
> >>>>>>> this?  What is Topbraid Ensemble calling to do the same?
>
> >>>>>>> So, does this functionality exist, and if so, how do I access it
> >>>>>>> from
> >>>>>>> a web application?
>
> >>>>>>> Thanks,
>
> >>>>>>> Kev
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to