On 8/8/2013 8:01, Steve Ray (CMU) wrote:

Hi,

I'm having trouble mapping two related classes in class A (in this case "json") to two similarly related classes in class B (in this case "cmusc"). I was planning to use the spinmap:targetResource function, but in this case it doesn't seem to allow this function to cross to a second class (see the red triangle in the attached .png).

This must come up frequently, so I must be missing something, yes?


The short answer is that you need a mapping context (e.g. buildURI) between the two classes before you can add mappings.

A bit of background. If you define a mapping context between two classes, then you tell the system how to translate the URI of a resource on the left into URIs for the class on the right. These might be equal or URI derivation functions such as buildURI. Then when you connect two properties, the engine can use the context to figure out the source subject and the target subject for the new triple, while the value itself will be computed using the transformation function. This is how it works when you start a connection at a *property* - the transformation will use the *value* of the given property as its starting point.

Now, if you define a mapping starting with the upper right corner of a class, then you tell the system to use the URI of the source instance itself as input to the transformation function. Indeed this could be the spinmap:targetResource function, or any other that takes a URI resource as its first input argument. If the system would allow you to link the URI to a property in any unrelated class on the right, then there would be no context to figure out what the source and target subjects should be. To prevent this, the UI disallows creating such links.

I am not exactly sure what you are trying to model, but I assume you want to map all values from json:device_agent to cmusc:hasAgent. So just drag a line between those. Then select spinmap:targetResource with the context from the lower mapping so that SPINMap can turn the json:Device_Agent into the corresponding smusc:DeviceAgent.

HTH
Holger

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary 
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbraid-users@googlegroups.com
To unsubscribe from this group, send email to
topbraid-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
--- 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 topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to