9 Replies Latest reply on Jul 7, 2010 1:07 PM by 586185

    MultiLanguage Support  queries in SDO_RDF_MATCH

    586185
      Hello;

      I can insert rows that have language specification for en/es with INSERTs.

      I see in the table that I have two rows, one for RDFLANG -es- and another one for -en-.

      The question is how can obtain with SDO_RDF_MATCH only the statement for the -es- language if I do not know what is the information of the label.

      ( ?Person :hasName ?Name @es ) or similar ...

      Best

      Isidro
        • 1. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
          Mannamal-Oracle
          RDFLANG information can be retrieved as part of the SDO_RDF_MATCH query:

          SELECT o, o$rdflang FROM TABLE(SDO_RDF_MATCH(......

          The selected o$rdflang variable can be used to filter rows.

          Melli
          • 2. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
            586185
            Hello again;

            After 2 years I am testing again the Oracle 11G new features to validate it to our system integrations.

            a) Multilingual support.
            Is now possible to make sem_match questions about the lang ?.
            I tried to use FILTER langMatches(lang(?Label),"es") for example to filter this.. but in the results are column with Label$rdflang in en/es/..

            b) More information associated to statement. For example the position order for the property in the class (not the order clause).
            What is the way to do it, with reifications ?

            Regards


            Isidro
            • 3. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
              Matperry-Oracle
              Hi Isidiro,

              For question (a):

              FILTER (langMatches(lang(?label), "es")) should work. However, there are some known issues with the implementation of langMatches() in 11g Release 2. The issues have been fixed in the latest patchset (Patch 9819833: SEMANTIC TECHNOLOGIES 11G R2 FIX BUNDLE 2) available from My Oracle Support.

              As a workaround, you can use FILTER (lang(?label) = "es") or FILTER (REGEX(lang(?label), "...")) for more complex expressions.

              For question (b):

              I'm not sure I understand your question. Can you please clarify with an example.

              Thanks,
              Matt
              • 4. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
                586185
                Hello again;

                Firstly thank you, the (a) part relative to multilingual access works fine.

                In the (b) part I mean the treatment of n cardinality.

                For example; a shopping cart that has any articles where the position is relevant.

                myshopping_cart pos 0 hasArticle article1
                myshopping_cart pos 1 hasArticle article2
                myshopping_cart pos 2 hasArticle article3

                This is, the triple (Subject, property, object) has other attributes. What is the way to do this, with reifications quads?

                Regards

                Isidro
                • 5. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
                  766393
                  Hi,

                  As I am quite new to semantic web technologies, I might not understand your question completely, but, I was wondering :
                  About your example : Isn't rdf:Seq sufficient ?
                  e.g.
                  myshopping_cart hasArticles articles
                  articles rdf:type rdf:Seq
                  articles rdf:_1 article1
                  articles rdf:_2 article2
                  articles rdf:_3 article3

                  Or is your question a general question about reification and Oracle Semantic Technologies ?

                  Thanks,
                  Regards,
                  Julien
                  • 6. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
                    715399
                    If you want to maintain ordering information , you might also want to use rdf:List. To handle your example, you would use something like:

                    myshoppingcart hasArticles _:head.
                    _:head rdf:first article0.
                    _:head rdf:rest _:item1.
                    _:item1 rdf:first article1.
                    ...
                    _:itemn rdf:rest rdf:nil.


                    Even though rdf:list and rdf:seq will work for you example, In the general case, you might need to user reification as you suggested if you want to associate generic information with triples.
                    You can read this for more information:
                    http://www.w3.org/TR/rdf-mt/#Reif

                    Oracle supports loading and querying reified triples (they are just like any other triples, with the exception of having to add 4 extra triples per original triple to reify it, so your data set size will increase).

                    Vladimir
                    • 7. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
                      586185
                      Hello;

                      Thank you for your response.

                      rdf:bag, rdf:sequence, rdf:list do not cover all the cases.

                      For example; the quantity

                      If you need to say ;

                      myShoopingCarg hasArticle article1 Qty 5
                      myShoopingCarg hasArticle article2 Qty 4

                      You can make a sequence to say the cardinality (position), but to say quantity ?

                      I know this;
                      Subject Property Object
                      ID1 myShoopingCarg hasArticle article1
                      ID2 ID1 hasPosition 1
                      ID3 ID1 hasQty 5

                      Is it possible to do this instead of reified quad, that need 4 triplas


                      Regards

                      Isidro
                      • 8. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
                        Matperry-Oracle
                        Thanks for the input Julien.

                        As another alternative, you could use an intermediate node to facilitate a ternary relationship. For example,

                        :myshopping_cart hasArticle _:a1 .
                        _:a1 :pos 1 .
                        _:a1 :hasArticle :article1 .

                        :myshopping_cart hasArticle _:a2 .
                        _:a2 :pos 2 .
                        _:a2 :hasArticle :article2 .

                        :myshopping_cart hasArticle _:a3 .
                        _:a3 :pos 3 .
                        _:a3 :hasArticle :article3 .

                        In general, using a sequence or using this intermediate node strategy will most likely work better than reification in practice.

                        Cheers,
                        Matt
                        • 9. Re: MultiLanguage Support  queries in SDO_RDF_MATCH
                          586185
                          Yeeessss

                          This is I need, thanks to all

                          Regards

                          ISidro