On 10/9/2015 1:13, Matt McMinn wrote:
I've attached the simple dataset that I'm using, which includes a screenshot of my current mapping.

I am using a simple changeNamespace mapping to map Items to Orders, which seems to work OK. As the screenshot shows, I've also managed to get the item:price values to show up in the orders:totalPrice field (my original issue I think was fixed with a rebuild of the project). So I think my new question is how I can get orders:totalPrice to equal item:price times orders:quantity. If I select the sp:mul transformation function, I can only select properties from the Item class.

Ok thanks for the details. SPINMap was designed to cover certain use cases where you have a source class and a target class and mappings from left to right. In your scenario you try to mix properties from the source and the target class, and run into limitations of the framework. I cannot even think of a suitable visualization for such cases, and that is a major "selling point" of SPINMap.

You'd need to express such cases in SPARQL using spin:rule, and in principle also make sure that mapping happens iteratively, because the values of orders:quantity may not yet exist when the multiplication rule is executed. I see that your data already has the quantity triples, so this is not relevant here. A possible query could look like

CONSTRUCT {
    ?target orders:totalPrice ?totalPrice .
}
WHERE {
    {
        ?this items:price ?price .
BIND (spinmap:targetResource(?this, items2Orders:Item-Order) AS ?target) .
    } .
    ?target orders:quantity ?quantity .
    BIND ((?quantity * ?price) AS ?totalPrice) .
}

where items2Orders:Item-Order is the spinmap:Context. I have not tried this to completion because I don't understand how you did the changeNamespace to go from items:Item0 to orders:Order0.

Holger



Thanks

Matt

On Wednesday, October 7, 2015 at 10:11:38 PM UTC-4, Irene Polikoff wrote:

    Matt,

    If you have some test data imported or added into your SPINMap
    graph, you will see some information as you create mappings. After
    your SPINMap is finished, you can drop it.

    For example, when you draw a line between classes and define the
    changeNamespace function, you should see right away examples of
    the URIs being created without having to run inferencing as a
    separate step. Check that they make sense. In this case,
    correspond to the URIs of the resources that are members of the
    Order class.

    As I understand it, in your data, the URIs of the items and orders
    will match as longer as you change the namespace. For example, you
    have www.example.org/items/x123
    <http://www.example.org/items/x123> and correspondingly
    www.example.org/orders/x123 <http://www.example.org/orders/x123>,
    so that the only thing you need to do is replace
    www.example.org/items/ <http://www.example.org/items/> with
    www.example.org/products/ <http://www.example.org/products/>.
    Correct? If this is not true, you need to have a different mapping
    function.

    Then, I am not sure that I understand what you mean by "I then
    drew a line from the Item class to a new property on the Order
    class, totalPrice, and set the function to equals, just to see if
    I can get the property to show up". I would think you need to draw
    a line from the unitPrice property in the Item to the new
    totalPrice property in the Order.

    Irene Polikoff


    From: Holger Knublauch <[email protected] <javascript:>>
    Reply-To: <[email protected] <javascript:>>
    Date: Wednesday, October 7, 2015 at 9:44 PM
    To: <[email protected] <javascript:>>
    Subject: Re: [topbraid-users] Connect disparate data sources with
    TopBraid Composer

    Hi Matt,

    do you have a small example file of what you have tried so far,
    and where it failed? You will understand that it is quite
    difficult and time consuming to reproduce exactly the same
    scenario that you had. In principle I see no problems with your
    proposed solution, although SPINMap does have its limits and
    sometimes it is indeed faster to just rely on SPARQL CONSTRUCT
    rules to do the work.

    Holger


    On 10/8/2015 3:24, Matt McMinn wrote:

    I'm working on a proof of concept to explore how to connect
    SPARQL data from different data sources. I have two OWL classes,
    each from its own data model, representing information that I've
    extracted from two different systems. The data models look like:

    |Order: id, itemName, quantity Item: id, name, unitPrice |


    What I would like to do is connect these two types together using
    the Order.itemName and Item.name fields, and create a new field
    on the Order class to store the total price for the order
    (order.quantity * item.unitPrice).


    This would be fairly trivial to do with SPARQL, but we're looking
    at TopBraid Composer due to its graphical mapping capabilities,
    which would be easier for an end user to work with. From my
    understanding, using a SPINMap we should be able to easily - and
    graphically - define the above property, but I'm having some
    problems getting things connected together.


    I've been following the tutorial in the TBC Help under
    "Application Development Tools/SPIN/Ontology Mapping with
    SPINMap", but I'm having problems just trying to get a simple
    attribute mapped over. Based on that help document, on the
    Diagram tab I'm drawing a line from the Item Class to the Order
    class and selecting the changeNamespace function with an
    appropriate value. I then drew a line from the Item class to a
    new property on the Order class, totalPrice, and set the function
    to equals, just to see if I can get the property to show up.
    After running the inferences, I run a SPARQL query, and the
    totalPrice field is empty for all of my Order classes.


    I know this description was confusing - any idea what I should be
    doing to make this work?  Is a SPINMap even the right tool for
    this, or is just straight SPARQL the way to go?


    Thanks


    Matt

-- You received this message because you are subscribed to the
    Google Group "TopBraid Suite Users", the topics of which include
    Enterprise Vocabulary Network (EVN), Reference Data Manager
    (RDM), TopBraid Composer, TopBraid Live, TopBraid Insight,
    SPARQLMotion, SPARQL Web Pages and SPIN.
    To post to this group, send email to [email protected]
    <javascript:>
    ---
    You received this message because you are subscribed to the
    Google Groups "TopBraid Suite Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected] <javascript:>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

-- You received this message because you are subscribed to the Google
    Group "TopBraid Suite Users", the topics of which include
    Enterprise Vocabulary Network (EVN), Reference Data Manager (RDM),
    TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion,
    SPARQL Web Pages and SPIN.
    To post to this group, send email to [email protected]
    <javascript:>
    ---
    You received this message because you are subscribed to the Google
    Groups "TopBraid Suite Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected] <javascript:>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), Reference Data Manager (RDM), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Group "TopBraid 
Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), 
Reference Data Manager (RDM), TopBraid Composer, TopBraid Live, TopBraid Insight, 
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
--- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to