Melanie, Instead of this
@@Table2.InstrumentName-Table1.logID|urlify@@ try something like this: @@Table2.InstrumentName|urlify@@/@@Table1.logID@@ Each individual column (with column function, if any) needs to be enclosed in @@doubleAts@@. (I've used a slash "/" instead of a dash "-" as the separator to avoid problems in the case that the instrument name contains a dash. If you use a separator that *can* occur in the column, and is *not* encoded by the column function, then there could be problems. The slash is encoded by urlify, so it is safer.) Then you can have one class map for experiments with the pattern above, and a second class map for instruments with a pattern based only on the instrument name. You can have a property bridge that connects the two class maps simply by having its d2rq:belongsToClassMap point to the one, and its d2rq:refersToClassMap to the other. The property bridge for the name of the experimenter would require a join on Table1.logID=Table2.logID so that the right experimenter name is associated with the right instrument. Best, Richard On 21 Feb 2013, at 22:02, Melanie Courtot wrote: > Hi all, > > I am trying unsuccessfully to link properties to values depending on columns > in two tables. Here is an example (the database I work with is unfortunately > not normalized). > > I have a usage logs for instrument in my lab. Here are two tables: > > Table 1: columns logID, researcher, date > Table 2: columns logID, instrument_name, instrument_manufacturer, filter_used > > Every time an experiment is made, it gets an ID, name of researcher and date, > such as > > 1 Melanie 20130221 > 2 Ryan 20111101 > > Every time an experiment is made, a flow cytometer is used, such as > 1 FacsAria BD filter 1 > 1 BioSorter UBiometrica filter 72 > 2 FacsAria BD filter 5 > > > The instrument name and manufacturer are always linked (all FacsAria are > manufactured by BD), but the type of filter used depends on the experiment > performed (i.e., the logID) *and* the instrument name. So for example return > filter 1 only if logID = 1 *and* name is FacsAria. (as seen in the other > record, I could use the FacsAria with another filter, filter5, in another > experiment) > > Also, several different instruments can be used within one experiment, such > as in the example above where in experiment one two instruments (therefore > two filters) were used. > > I created a classMap per logID, and a classMap per instrument. As I am using > the instrument name to mint the URI, all records of FacsAria show up on the > same page - which displays "has_filter 1, has_filter 2" without associating > the correct filter with the correct logID. I chose to do it that way as I can > then have a FacsAria page showing me all the experiments it was used in. > Maybe the right way to proceed would be to create a classMap for each couple > "InstrumentName-logId" and add the propertyBridge to those. I couldn't get > the correct pattern to urlify though: if I try > @@Table2.InstrumentName-Table1.logID|urlify@@ it gives me an error. I am also > unsure how to link that to the "general" FacsAria above. > > I thought maybe the example at http://d2rq.org/d2rq-language#example-refers > would help, but nothing shows up when I try and adapt it to my case (either > in the browser or the dump file) > > I am not sure how to get that mapping right - any suggestion? > > Thanks, > Melanie > > > ps: I hope this email is clear; I tried to reduce my example to the minimum > information needed to understand the problem. Apologies if it is somewhat > hard to read or if information is missing. > > > > --- > Mélanie Courtot > MSFHR/PCIRN Ph.D. Candidate, > BCCRC - Terry Fox Laboratory - 12th floor > 675 West 10th Avenue > Vancouver, BC > V5Z 1L3, Canada > > > > > > > > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > d2rq-map-devel mailing list > d2rq-map-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ d2rq-map-devel mailing list d2rq-map-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel