IS BIND() & COALESCE() supported in SEM_MATCH and if not what's alternative?

I want to get rid of all these UNIONs and USE virtual model VISION instead of all these models: COMPASS, PROCESS, LIMS_ANALYTIC, CLOVER in SEM_MODEL() function...
Jena:       VERSION: 2.11.1
ARQ:       VERSION: 2.11.1
RIOT:       VERSION: 2.11.1
I know the query is large but I am trying to simplify it because it takes FOREVER!!
SELECT DOMAIN, AGE_OF_DATA FROM
  SELECT Domain, max(protDate) as age_of_data FROM
  SELECT DOMAIN$_SUFFIX AS Domain, protNum, NVL(protStartDate, protCreateDate) AS protDate
  FROM TABLE(SEM_MATCH(
   ?ipc rdf:type s:Protocol .
   ?ipc s:hasDataSource :COMPASS .
   ?ipc s:protocolNumber ?protNum .
   ?ipc s:protocolCreateDate ?protCreateDate .
   OPTIONAL {?ipc s:protocolSchedStartDate ?protStartDate }
*******BIND(COALESCE(?protCreateDate, ?protStartDate) AS ?age_of_data)  ***** <== can I use that instead of NVL() function above?
   ?ipd rdf:type s:Protocol .
   ?ipd s:hasDataSource ?domain .
   ?ipd s:protocolNumber ?protNum .
    }',SEM_Models('COMPASS','EDHRD','CLOVER'),NULL,
    SEM_ALIASES(SEM_ALIAS('','http://VISION/Data/SEMANTIC#'),SEM_ALIAS('s', 'http://VISION/DataSource/SEMANTIC#')),NULL,NULL,'ALLOW_DUP=T'))
   ORDER BY DOMAIN$_SUFFIX, protDate desc
    Group by Domain
   UNION
   SELECT 'LIMS_ANALYTICAL' as Domain, chgDate as age_of_data FROM
  SELECT chgDate
  FROM TABLE(SEM_MATCH(
   ?ipc rdf:type s:Test .
   ?ipc s:testChangeDate ?chgDate .
  }',SEM_Models('LIMS_ANALYTIC'),NULL,
  SEM_ALIASES(SEM_ALIAS('','http://VISION/Data/SEMANTIC#'),SEM_ALIAS('s',  'http://VISION/DataSource/SEMANTIC#')),NULL,NULL,'ALLOW_DUP=T'))
  ORDER BY chgDate desc
  WHERE ROWNUM = 1
   UNION
   SELECT process as Domain, substr(max(procEndDate),1,10) as age_of_data  FROM
  SELECT  process, protNum, procEndDate
  FROM TABLE(SEM_MATCH(
  ?ipra rdf:type s:ProcessAggregate .
  ?ipra s:hasProtocol ?iprot .
   ?iprot s:protocolNumber ?protNum .
  ?ipa    s:hasEquipment  ?iequ .
  ?iequ  s:pilotLineProcessName   ?process.
     ?ipra s:processAggregateCaptureTimeEnd ?procEndDate .
   }',SEM_Models('COMPASS','PROCESS'),NULL,
   SEM_ALIASES(SEM_ALIAS('','http://VISION/Data/SEMANTIC#'),SEM_ALIAS('s',  'http://VISION/DataSource/SEMANTIC#')),NULL,NULL,'ALLOW_DUP=T'))
   Group by process
    UNION
   select 'Tooling_Design'  as Domain, protocol_start_date as age_of_data
   from
   select protocol_start_date from mv_lot_detail l, mv_lot_design d
   where l.protocol_start_date is not null and l.fp_pr = d.fp_pr and l.bp_pr = d.bp_pr
   order by l.protocol_start_date desc
  Where rownum = 1

I changed it so it looks better:
SELECT DOMAIN, AGE_OF_DATA FROM
   SELECT CASE WHEN INSTR(Domain, '#') > 0 THEN SUBSTR(Domain, 29, INSTR(Domain, '#')-1)
          ELSE DOMAIN  END DOMAIN,
          SUBSTR(max(age_of_data), 1, 10) AGE_OF_DATA
    FROM
  SELECT domain_name AS Domain, protNum, NVL(protStartDate, age_of_data) AS age_of_data
  FROM TABLE(SEM_MATCH(
                     ?ipl   rdf:type s:Protocol .
                     ?ipl   s:hasDataSource :COMPASS .
                     ?ipl   s:protocolNumber ?protNum .
                     ?ipl   s:protocolCreateDate ?age_of_data .
                  OPTIONAL {?ipl s:protocolSchedStartDate ?protStartDate }
                     ?iec   rdf:type s:Protocol .
                     ?iec   s:hasDataSource ?domain_name .
                     ?iec   s:protocolNumber ?protNum .
               UNION
                     ?pag   rdf:type         s:ProcessAggregate .
                     ?pag   s:hasProtocol    ?iprot .
                     ?iprot s:protocolNumber ?protNum .
                     ?pag   s:pilotLineProcessName   ?domain_name.
                     ?pag   s:processAggregateChangeDateTime ?age_of_data .
               UNION
                     ?lim   rdf:type   s:Submission .
                     ?lim   s:hasDataSource  ?domain_name.
                     ?lim   s:submissionChangeDate ?age_of_data .
    }',SEM_Models('COMPASS','EDHRD', 'CLOVER', 'PROCESS', 'LIMS_ANALYTIC'),NULL,
    SEM_ALIASES(SEM_ALIAS('','http://VISION/Data/SEMANTIC#'),SEM_ALIAS('s', 'http://VISION/DataSource/SEMANTIC#')),NULL,NULL,'ALLOW_DUP=T'))
   ORDER BY domain_name
    Group by Domain
UNION
   select 'Tooling_Design'  as Domain, max(protocol_start_date) age_of_data
        from semantic_read_only.mv_lot_detail l, semantic_read_only.mv_lot_design d
        where l.protocol_start_date is not null and l.fp_pr = d.fp_pr and l.bp_pr = d.bp_pr

Similar Messages

  • When I try to purchase new app or update apps on iPad it tells me user name is disabled.  I have done all the "tricks" from the tech support on phone and still not working.

    When I try to purchase new app or update apps on iPad it tells me user name is disabled.  I have done all the "tricks" from the tech support on phone and still not working.

    Contact Apple Support
    https://expresslane.apple.com/GetproductgroupList.action
    Apple ID: "This Apple ID has been disabled for security reasons" alert appears
    http://support.apple.com/kb/ts2446
     Cheers, Tom

  • HT1904 How can I get a refund for apps in the apple App Store that do not work and are not what they said they wer

    How can I get a refund for apps in the apple App Store that do not work and are not what they said they wer

    You've tried deleting and redownloading them and seeing if they then work and tried contacting the developers ? If you have and they can't/won't help then try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I cant download itunes and i cant use my new ipod 4 that i got yesterday. How can i download it and if not what do i do?

    I can't download itunes and i got an ipod 4th generation yesterday which wont work without it. How can i download it and if not what do i do?

    You can try the direct download link from Apple.

  • Hello I've forgotten my security questions and also forget what the alternative e-mail, please Create

    Hello I've forgotten my security questions and also forget what the alternative e-mail, please Create

    account security
    Please call apple @ 1-800-694-7466
    ask for the account security team
    you may want to add a credit card to your iTunes account  before calling; so they will have a way to verify your identity.
    Peace, Clyde

  • Hello everyone, So When I use the eraser on a photo and try to save it as jpeg is makes is save it as a copy but the parts that I erased are replaced with a white background and thats not what I want

    Hello everyone, So When I use the eraser on a photo and try to save it as jpeg is makes is save it as a copy but the parts that I erased are replaced with a white background and thats not what I want

    That may not be what you want, but Jpeg images are flattened, without transparency.  Every pixel has a color value, with the default background usually being white.  If you want to crate an image that leaves the erased area transparent, you will need to use an image format such as .gif or .pnc.

  • How to upgrade my add on to support firefox 4 and above ? what changes needs to be done?

    I have an add on currently it is supporting only below firefox 4 versions. What changes needs to be done to support firefox 4 and above?
    Is there any reference to specify the list of differences? How to upgrade addon to support future version?
    Thanks ,
    Dinesh

    A good place to start would be https://developer.mozilla.org/en/Updating_extensions_for_Firefox_4

  • I have an older MAC running OSX 10.4.11. Can I get a free download of Firefox supported by my operating system? (Apple no longer supports my computer and does not have an update available for my operating system)

    would like to download Firefox but new version is not supported by my operating system

    Firefox 3.6.x is the last available from Mozilla for 10.4.11 PPC Macs. <br />
    http://www.mozilla.com/en-US/firefox/all-older.html

  • Smart playlists that reference other playlists are not supported by iCloud, and will not be updated? Unacceptable

    Just as it says^
    There are tons of types of rap.  rap1 rap2 rap3 rap4 rap5.  It is unacceptable to disallow me from making a superset playlist "Rap all" that includes rap1 rap2 rap3 rap4 rap5. 
    I have to say, apple's reputation (built on reliability and comprehensive understanding of products/options/uses) is beginning to dishearten it's users and muddy the brand that has been built with hard work and dedication.
    This simple programming lapse needs to be fixed immediately.
    Thanks.

    I'm in the same boat. I typically sync one playlist to my iPhone, plus a smart playlist that contains 4 GB of random music that's not already in any pre-synced playlists.
    Needless to say this doesn't work anymore. Why? Because of the aforementioned "Smart Playlists referencing other playlists" problem, PLUS the fact that Smart Playlists in iTunes Match don't observe any sort of size limitation at all when viewed on an iOS device.
    That means that the same smart playlist on my PC has 500 songs @ 4GB, while on my iPhone or iPad the list contains 5,000 songs!
    This is seriously a "what the **** have you guys been testing for the past 10 months?!" kind of rollout.

  • Why can't I get Adobe Flash player for iPhone, and if not, what else can I

    Help! I want to view videos and can't do it. No flash player available. Why not?!!
    Please help.

    There is no flash player for the iphone and Adobe would be the one to develop one, not Apple. And there are no plugins to install instead, as far as I know.

  • Does iTunes 10.7 (Cover-Flow work with Mavericks and if not what do I have to do?

    What do I have to do to keep my 10.7 iTunes (Cover-Flow) with Mavericks?
    Thanks guys all appreciated responses will be accepted in this matter.

    I just had the similar issue. I redeemed my iTunes gift card then went to download something and was asked for my billing info. I completed the information and I think accepted terms and then had a pop-up telling me that my my account would be debited with the purchase. My VISA (billing info) did not appear to be charged as my gift card amount showing in the top right decreased with the purchase. So I just completing the information and hopefully it will happen the same for you! Good luck!

  • Are there any relay modules available for Compact Fieldpoint, and if not, what are the alternatives?

    I'm speccing out a Fieldpoint system, and although Compact Fieldpoint has many features that make it superior to Fieldpoint for my application, I'm wondering why no relay modules seem to be available for it.
    The cFP-RLY-420 is referenced in the manual it shares with the FP-RLY-420, and a search in the product section comes up with several pages that aren't viewable, but it doesn't seem to be currently available.
    More importantly, if there are no relay modules available at this time, what would be the alternatives for switching? A small Opto22 backplane wired to a DO module perhaps?

    Mako,
    Several of the more specialized modules in FieldPoint have not yet been released in Compact FieldPoint. However, National Instruments is presently working on releasing most of these traditional FieldPoint module in the future.
    Depending on your application, either the cFP-DO-401 or cFP-DO-410 (which are both providing sourcing outputs) may be a possible alternative. The DO-401 module can sustain up to 2 A per channel, 8 A squared per module whereas the DO-410 can sustain up to 1 A per channel. Please note that these modules only handle low voltage DC.
    Regards,
    Cyril Bouton
    Applications Engineer
    National Instruments
    Cyril Bouton
    Active LabVIEW Developper

  • I have an iPhone 5s. I have not been able to use the airdrop feature since I my os last week. Am I the only one and if not what can be done?

    I can't get the airdrop feature to work since I updated my iOS to the latest version. Am I doing something wrong?

    using airdrop http://support.apple.com/kb/ht5887

  • I'm looking into the possibility of using Photoshop CS2 on Imac with Mavericks OS. Is this even possible, and if not, what would I need to do?

    Is it possible to download and use Photoshop CS2 on Imac with Mavericks OS?

    This is not a photography question.  It is an application specific question,  Please post in the Photoshop forum.
    Photoshop General Discussion
    Remember, you are not addressing Adobe here in the user forums.  You are requesting help from volunteers users just like you who give their time free of charge. No one has any obligation to answer your questions.

  • Just switched from pc to mac book and itunes not what it used to be

    I just made the switch. I used an external hard drive that I was using anyway to hold my itunes library to move my music and itunes content over to the new computer. When I restarted itunes with existing ipod, the itunes set up was different. I had two different play lists; one on itunes and one set that pops up when ipod is connected. very strange. I just purchased an iphone and I am having a real dandy getting the music to sync onto the phone. I think it started with the transition.....
    I hope this is clear as mudd! thanks for any advice or assistance!

    When you swap you have to remake your playlists I think. i don't have an iPhone so i can't help there sorry.

Maybe you are looking for