SPARQL query through Jena adaptor not work when string literals used

Hi,
When I executed the following SPARQL query through Oracle Jena adaptor:
SELECT ?personHasFirstName WHERE
{?personHasFirstName foaf:firstName ?name . }
I got the expected results.
However it won't return anything when I narrowed the query to match a particular name like below:
SELECT ?personHasFirstName WHERE
{?personHasFirstName foaf:firstName \"Julie\" . }
I also tried the Filter approach:
SELECT ?personHasFirstName WHERE {?personHasFirstName foaf:firstName ?name . FILTER (?name =\"Julie\") }
It still doesn't return any results.
I saw from the release notes about the bug dealing with "\". My guess is that the above behavior is caused by that bug. What is the suggested way to walk-around this? Thanks,
Weihua

Could you please try this? It works as expected on my machine.
GraphOracleSem graph = new GraphOracleSem( oracle, modelName);
ModelOracleSem model = new ModelOracleSem(graph);
Node sub = Node.createURI("http://test.com/employee123");
Node pre = Node.createURI("http://xmlns.com/foaf/0.1/firstName");
Node obj = Node.createLiteral("Julie");
graph.add(Triple.create(sub, pre, obj));
String queryString =
" PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
"SELECT ?person WHERE { ?person foaf:firstName \"Julie\" . } ";
QueryExecution qexec = QueryExecutionFactory.create(
QueryFactory.create(queryString), model);
try {
ResultSet results = qexec.execSelect();
while (results.hasNext()) {
QuerySolution soln = results.nextSolution();
psOut.println("runQuery: soln " + soln);
finally {
if (qexec != null)
qexec.close();
output snippet:
runQuery: soln ( ?person = <http://test.com/employee123> )

Similar Messages

  • Form in Dynamic page not working when checkbox is used.

    I have created a form using dynamic page. The form most have display fields and a checkbox field. When I check a box, it assigns 'Y' value and when unclick, it assign 'N' to the database field.
    When I submit the form, the procedure which is supposed to save the form data never gets executed. Well, at least it says, page not found HTTP 404 error.
    Interestingly if I make this field a text box and manually enter 'Y' or 'N', and then submit the form, the procedure is executed. Data gets saved.
    Is the checkbox not supposed to be used for a database field because checkbox value can be assigned only using javascript and the procedure never get that value ?
    Can you please tell me how to use a checkbox for a database field using dynamic page ?
    thanks,
    Mainak

    Sharmila,
    When I said, the form does not get submitted, I meant that the procedure does not work. The form gets submitted but the procedure does not work. It gives HTTP 404 error. That is what perplexes me. I am unable to understand why the procedure does not work when I click a checkbox.
    May be you can make this work. I am hopeless about this.
    Here is the code for the procedure sumbit_form:
    NOTE: I ADDED TWO FIELDS CALLED PROMOT VARCHAR2(1), PROMOTID NUMBER(4) TO THE EMP TABLE AND CREATED A NEW TABLE CALLED PROMOTEMP. THIS IS A TEST CASE.
    create or replace procedure sumbit_form
    (p_empno IN portal30.wwv_utl_api_types.vc_arr, p_promot IN portal30.wwv_utl_api_types.vc_arr, p_action IN VARCHAR2)
    is
    begin
    if p_action = 'save' then
    for i in 1..p_empno.count LOOP
    update scott.promotemp
    set promot = p_promot(i)
    where empno = p_empno(i);
    END LOOP;
    end if;
    commit;
    htp.p('<b>Saved Successfully</b>');
    htp.p('<table border=1 bordercolor="red">');
    for c1 in (select * from promotemp where promot='Y')
    LOOP
    htp.p('<tr><td>');
    htp.p(c1.ename);
    htp.p('</td><td>');
    htp.p(c1.job);
    htp.p('</td><td>');
    htp.p(c1.mgr);
    htp.p('</td><td>');
    htp.p(c1.sal);
    htp.p('</td><td>');
    htp.p(c1.deptno);
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    EXCEPTION
    when others then
    raise;
    end;
    Here is the code for the dynamic page.
    <HTML>
    <HEAD>
    <TITLE>Promot Emp</TITLE>
    <script language="JavaScript1.1">
    function include(form) {
    var thisform = form;
    for (var i=0; i<thisform.length; i++) {
         if (thisform.elements.type == 'checkbox') {
              if (thisform.elements[i].checked) {
                   thisform.elements[i].value = 'Y'; }
              else { thisform.elements[i].value = 'N'; }
    form.submit();
    function show(form) {
    var thisform = form;
    for (var i=0; i<thisform.length; i++) {
         if (thisform.elements[i].type == 'checkbox') {
              if (thisform.elements[i].value = 'Y') {
                   thisform.elements[i].checked = true; }
              else { thisform.elements[i].checked = false; }
    </script>
    </HEAD>
    <BODY>
    <FORM action="scott.sumbit_form" method="post">
    <table border=1 bordercolor="red">
    <tr>
    <td> </td>
    <td>Name</td>
    <td>Job</td>
    <td>Manager</td>
    <td>Hire Date</td>
    <td>Commission</td>
    <td>Department#</td>
    <td>Include</td>
    </tr>
    <ORACLE>declare
    i number;
    begin
    i := 0;
    for c1 in (select * from scott.promotemp where promotid = :promotid)
    loop
    htp.p('<tr><td>');
    htp.p('<input type="hidden" name="p_empno" value='||c1.empno||'>');
    htp.p('</td><td>');
    htp.p(c1.ename);
    htp.p('</td><td>');
    htp.p(c1.job);
    htp.p('</td><td>');
    htp.p(c1.mgr);
    htp.p('</td><td>');
    htp.p(c1.hiredate);
    htp.p('</td><td>');
    htp.p(c1.comm);
    htp.p('</td><td>');
    htp.p(c1.deptno);
    htp.p('</td><td>');
    if (c1.promot = 'Y') then
    htp.p('<SELECT NAME="p_promot" SIZE="1">
    <OPTION SELECTED VALUE="'||c1.promot||'">Yes
    <OPTION VALUE="N">No
    </SELECT>');
    else
    htp.p('<SELECT NAME="p_promot" SIZE="1">
    <OPTION SELECTED VALUE="'||c1.promot||'">No
    <OPTION VALUE="Y">Yes
    </SELECT>');
    end if;
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    htp.p('<input type="submit" value="save" name="p_action">');
    end;
    </ORACLE>
    </form>
    </BODY>
    </HTML>
    thanks,
    Mainak

  • Youtube does not work when i am using wifi on iphone 4

    the youtube does not work when i use wifi. it works perfectly when i use 3 g network ..

    At home when i use my Wi-Fi it work normal, but as soon as i go out, for example on the bus or at work it keeps saying "Cannot connect to Youtube".

  • Drag and drop not working when uploading file using safari

    why i cannot drag and drop any file when using safari , and what happens the file auotmatically open while i need to upload it only , extra for that , i cannot write  any remark or fill a space while using website related to my work.
    my work is to upload drawing files using dwf file to a website so the other parties can review and give me review , and then i reply to the remark at the same place and make meeting through the same site.
    please any body can give any way to correct my mac.
    latelly i installed win7 only to use it for that website , and iam now changing from mac to win whenever i want to work , this not acceptable to me because it is waste of time beside i like the mac and it working with other application but not for safari.

    why ?
    I'm sorry, but every OS is different.  You cannot expect all features of one to be in another.  Or alternatively, for similar features, be done it the exact same way. 
    It looks to me after a quick google search that winexplorer is basically the moral equivalent of the mac's finder to present the file system in different ways.  The OSX Finder also has alternative views of the file system, i.e., icons, list, columns.  Experiment with the list and column views and see if one of them are more to your liking.
    As for winexplorer on the mac.  I don't know if this simulates it or not but there is a program called Macintosh Explorer so check that out as well.
    And finally, in the end, as I said in my earlier post, no matter what, nothing on the mac is going to change what I believe you think you can do and drop a file on a browser window and expect it to upload.

  • Lookup expression is not working when I am using with in the rectangle box in SSRS

    I have two datasets with common member is ProgramID.
    I have followed the below steps,
    1. Added one table  (2x2) and mapped this table to dataset1. After that I have removed top row.                                               
    That means I am maintaing only  data row.
    2. Added group to the table (ProgramID). Now the programid is sitting at cell#(1,1) and  cell#(1,2) is blank
    3. I have verified the report with preview and able to see the data for my all programs. I have 5 programs
    4. my plan is adding chart and matrix reports to cell# (1,2). If I am adding chart/matrix to the cell#(1,2) then we can't contol the  cell alignments in terms of height x width.
     To resolve that problem, I have added one rectangle control to the cell#(1,2) then I have added my chart and matrix report
    5. After completing the report, I have verified with preview and able to see the reports (chart/matrix) for all my 5 programs by page wise (note: I have provided page break before for my rectangle)
    6. Till this point, I have no issues
    7. Now, I have added one more row under the group. so, we have our main table (2x2). Becuase of programId group we can only see 3 cells in total table  (cell# (1,1) =ProgramId  cell#(1,2)=chart and matix reports under rectangle box; cell#(2,1)=already
    merged with ProgramID group; cell#(2,2)= planned to add one more rectanlge and add two reports (chart and matrix)
    8. Now, i have added rectangle to cell#(2,2) then added chart and matrix reports within the rectangle.
    9. cell#(2,2) reports are needs to extract the data from dataset-2. Here we have common member is ProgramID (ds-1,ds-2)
    10. First I have tested for matrix report by adding lookup expression
          Matrix report (2x2)
         row-1: Cell(1,1)= Gender report heading ; cell(1,2)=Month  (column group)
         Note: month is also common member in both the datasets. 
         row-2: cell(2,1)--  =Lookup(Programid.value, Programid.value,Gender.value,"Dataset2")  (Gender data is Male and Female)
                    Cell(2,2) -- empty for now
     11. I have tried to preview the report and able to see the report without any issues and below are observations
            main Table (2 x2)
             Cell# (1,1)  = ProgramID --Returning all 5 programs properly
             Cell# (1,2)  = Dataset1 related report (chart and matrix reports under rectangle) -- able to see without any issues
             Cell#(2,1)  = We already know this is merged cell. i.e menas ProgramID dispalying
              Cell#(2,2)= Only Male record is dispalying in the matrix report which is under rectanlge (here we have applied Lookup expression.
    Note: male is the first record from the database and Female is the second record
    Also, observed that Cell#(2,2) matrix report is unable to display the gender count information when I have provided count value expression in the cell(2,2) within the matrix and the expression I have uses is
      = sum(Lookup(ProgramId.value,ProgramId.value,GenderCOunt.value,"Dataset2"))
    Please ask me if I am unable to explain or lengthy explain.
    Point : Why the lookup expression is giving the first record only (in case of gender #(male, female) and why it is unable to give the gendercount.  Gendercount cell is totally blank.
    Please help me.
    Kishore.

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Dynamic record group not working when apostrophes are used

    Hi Everyone,
    I have developed a Form for the most part everything is working as expected. However, there is a search functionality that is giving me problems. The issue is that when the user enters search criteria for last_name that has an apostrophe (O'brian) the search lov doesn't get populated because the dynamic record group is not getting created when the string has an apostrophe (ie O'brian). I have a dynamic record group that takes the user's search criteria and populates an LOV on the screen with the records that matched their criteria.
    Here is the code that is behind my search button where the dynamic RG gets created. It works fine for all searches that don't contain an apostrophe. Btw, the Oracle Forms version is 10g.
    DECLARE
    p_where_debtor varchar2(2000);
    p_where_liab varchar2(2000);
    rg_id RecordGroup;
    v_query varchar2(2000) := null;
    rg_name varchar2(2000):= 'RG_LIAB_LST';
    errcode NUMBER;
    BEGIN
    IF :SEARCH.cd_nb is null and
    :SEARCH.cd_seq is null and
    :SEARCH.f_name is null and
    :SEARCH.l_name is null and
    :SEARCH.mi_name is null
    then
    display_message ('Search criteria must be entered');
    raise form_trigger_failure;
    END IF;
    v_query := 'SELECT last_name, first_name, middle_name, c_no, c_seq
    FROM TABLE_VW2 WHERE 1=1';
    /*Search criteria entered by user*/
    IF :SEARCH.l_name_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(last_name) LIKE '''||UPPER(:SEARCH.l_name)||'%''';
    END IF;
    IF :SEARCH.f_name_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(first_name) LIKE '''||UPPER(:SEARCH.f_name)||'%''';
    END IF;
    IF :SEARCH.mi_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(middle_name) LIKE '''||UPPER(:SEARCH.mi_name)||'%''';
    END IF;
    IF :SEARCH.cdcs_nbr_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(c_no) LIKE '''||UPPER(:SEARCH.cd_nb)||'%''';
    END IF;
    IF :SEARCH.cdcs_seq_srch IS NOT NULL THEN
    v_query := v_query||' AND UPPER(c_seq) LIKE '''||UPPER(:SEARCH.cd_seq)||'%''';
    END IF;
    /*Make sure record group doesn't exisit*/
    rg_id := Find_Group(rg_name);
    /*If it doesn't exist then create record group*/
    IF id_null(rg_id) THEN
    rg_id:= create_group_from_query(rg_name,v_query);
    END IF;
    IF NOT id_null (rg_id) THEN
    delete_group (rg_id);
    rg_id:= create_group_from_query(rg_name, v_query);
    END IF;
    errcode := Populate_Group(rg_id);
    Any help would be greatly appreciated.
    Thanks,
    Adrian

    For every item where an apostroph can occur, do a
    REPLACE(:BLOCK.ITEM, '''', '''''');

  • Alerts not working when "reply" is used

    When I get a reply to a sms text, there is no alert, only the led flashes.  I do not have alerts turned off.  They work fine, when the message originates from the sender.

    Can u give us the details like which component you are using for alerts.

  • Syncronize Camera RAW not working when Auto is used

    I have a problem with settings not being updated in Camera RAW when using the 'Auto' function.
    I have to equalize exposure on a large number of RAW files (often 500+). The Auto function would be great, if it would only apply to the Exposure and not the other settings like contrast.
    To reproduce:
    Open 20 RAW files
    Select all images
    Click 'auto' under the 'tint slider'
    Observe that settings change on all images
    Now change any of the following settings (but NOT the Exposure slider!):
    - Contrast
    - Highlights
    - Shadows
    - Whites
    - Blacks
    Problem: only the settings on the first image are updated, the other images are not edited.
    When you change the Exposure slider, the other settings are updated (probably because the 'auto' mode is disabled).
    I have uploaded a small screen recording of this problem here https://www.youtube.com/watch?v=jGx6wV5v774&feature=youtu.be
    Using 'Synchronize' it is also not possible to copy over the settings to all images.
    I contacted Adobe over the phone, but they can only give the usual nonsense (reset your preferences, reinstall Photoshop, etc).
    I see other people with the same problem, did anybody find a solution or a workaround?

    You now slide it up to open the camera instead of tapping.

  • RCOUNT not working when SORT is used.

    Hi Everyone,
    I have a table report, and at the bottom of the page i want to have the total distinct of row counts.
    Department Name Emp ID Emp Name Phone
    Sales 11111 abc xxx-xxx-9999
    Sales 23335 xyz xxx-xxx-9939
    ITD 01235 ddd xxx-388-3999
    Accounting 10000 hgg xxx-388-9299
    Accounting 02020 qqq xxx-123-3355
    Total of Departments : 03 (I'm using RCOUNT for this and put it in the narrative)
    It works as default but if i click on Emp Name to sort then the Total of Departments will show the count of emp name which is 5 in this case.
    Has anyone had any solution for this?
    Thanks.

    Why can't you use COUNT DISTINCT in column properties? (instead of default)...
    Bring a new column (any column)...edit its formula and add COUNT with brackets wrapping column name - something like COUNT(Table.EmployeeName) - it should be better than RCOUNT

  • Pagecontext.forwardimmediatly not working when hashmap is used.

    Hello,
    I am trying to use as below:
    HashMap hm = new HashMap(1);
    hm.put("conc_called","YES");
    pageContext.forwardImmediately("OA.jsp?page=/XXX/xxPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    hm,
    true,
    "N");
    But i get an error message stating that the method doesn't exist. Any suggestions would be appreciated.
    Thank You
    PK

    Ranjit,
    That was awesome. You were able to figure out the issue even thought i haven't posted the import statement i have used for the hashmap. It worked now.
    Thanks a lot!!

  • Keyboard backlighting not working when using Windows in Boot Camp

    Hi, I'm posting this for a friend with a new Macbook Air. He says that his keyboard backlighting does not work when he is using it for Windows (don't know which, but probably Vista). Any ideas why? Thanks. Gary

    Install all the drivers needed when running boot camp - try for example inserting a DVD - then press the eject key - See if it comes out - If it doesn't install all the drivers - try Control Panel - If not try re-installing your version of Windows.

  • I have Cisco TelePresence SX10 and content sharing is not working when I am dialing through the bridge

    I have Cisco TelePresence SX10 and content sharing is not working when I am dialing through the bridge, I can share the content if I drag and drop from RMX, but if schedule the call in Resource manager or manually dial in from device the content is not going to other hand, I have tried to turn off encryption as well but still same issue. can you please help me out with this. I am from Lion co and purchased sx 10 recently.
    regards
    Hemang

    Can you please provide us with a little more information on your systems and configuration / topology, such as, what call control are you using (Cisco VCS, CUCM, other?). what type of "Bridge" are you using (is this a Cisco MCU, or Cisco TelePresence Server, or other device?), what versions of the software are on each of the devices, etc.  The more information we have about your environment will help us assist you better.  But saying that, if all your core equipment isn't Cisco, you may have more luck in the forums for the manufacturer of such equipment (ie Polycom's Support Community).
    Wayne
    Please remember to rate responses and to mark your question as answered if appropriate.

  • No matter how many times I reet my password, it will not work when trying to sign intothe App Store through my iPhone4S.

    No matter how many times I reset my password, it will not work when trying to sign intothe App Store through my iPhone4S.

    What is the error that you are seeing? Try to login using another App like GameCenter or iMessage? Also try logging in to other Apps like Facebook to check if it is your Internet connection problem.

  • I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    Welcome to the 'wonderful' world of HTML5 e-learning.
    In my view, from the issues I am seeing everywhere, HTML5 output from rapid e-learning tools such as Captivate is not ready for the kind of mobile device e-learning you want to develop.
    Sorry to be pessimistic, but you may need to consider going back to the drawing board and coding it from the ground up.

  • Setting the custom master page through powershell is NOT working

    Hi,
     I am writing the below code to set the  custom master page through powershell.
    But its not working .when i went to site settings-->master page --> in the drodown , the  maste page set is seattle.master ONLY, though my current master page is available in the dropdown.
     Can anyone pls help, whether i am missing in the below :
          Add-PSSnapin Microsoft.SharePoint.Powershell
           $SiteURL = "http://srvr1:22307/sites/SPW5"
        $weburl= $SiteURL
        $Site= Get-SPSite $SiteURL
        $web =  $Site.OpenWeb()
    $web.CustomMasterUrl = "/_catalogs/masterpage/myMasterpage.master"
    $web.MasterUrl = "/_catalogs/masterpage/myMasterpage.master"
    $web.Update()
    Das

    Hi,
    Is it a publishing page? If yes can you try the PowerShell scripts corresponding to the following code snippet?
    var publishingWeb = PublishingWeb.GetPublishingWeb(web);
    publishingWeb.CustomMasterUrl.SetInherit(inheritFromParent, false);
    publishingWeb.CustomMasterUrl.SetValue(masterPageUrl, false);
    publishingWeb.MasterUrl.SetInherit(inheritFromParent, false);
    publishingWeb.MasterUrl.SetValue(masterPageUrl, false);
    I've noticed sometime (not sure though) that Master page doesn't get updated if the inherit property is not updated first.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

Maybe you are looking for