Re: exmple for filter contains (sparql)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: exmple for filter contains (sparql)

Lorenz Buehmann
And you tried what so far? I mean it's not the first SPARQL question
from you, so you should be able to just do this or not?

What's wrong with using a filter e.g.
FILTER(CONTAINS(str(?your_literal_var_here), "Cough dry")) ? Does this
not work for you?

On 26.01.20 22:37, duha wrote:

> I have a phrase consist of two words
> I need to write query find a word using filter contains and strstarts such
> as(Cough dry)
>
> or another way to find this ??
>
> Thanks
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: exmple for filter contains (sparql)

duha
Thank you so much 

I 'm working in the Arabic language after steaming the word,, 
so I can't merge this 
I'm trying to do this, and its work correctly

 filter (contains(?x,"كح") && contains(?x,"ناشف"))

in English

 filter (contains(?x," Cough  ") && contains(?x," dry  "))







On Mon, Jan 27, 2020 at 10:12 AM Lorenz Buehmann <[hidden email]> wrote:
And you tried what so far? I mean it's not the first SPARQL question
from you, so you should be able to just do this or not?

What's wrong with using a filter e.g.
FILTER(CONTAINS(str(?your_literal_var_here), "Cough dry")) ? Does this
not work for you?

On 26.01.20 22:37, duha wrote:
> I have a phrase consist of two words
> I need to write query find a word using filter contains and strstarts such
> as(Cough dry)
>
> or another way to find this ??
>
> Thanks
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: exmple for filter contains (sparql)

duha
without stemming, your solution works correctly and I tried this before I sent this email, the problem occurs when the dataset stemming or lemmatization and ontology without stemming.







On Mon, Jan 27, 2020 at 10:24 AM Doha Hassan <[hidden email]> wrote:
Thank you so much 

I 'm working in the Arabic language after steaming the word,, 
so I can't merge this 
I'm trying to do this, and its work correctly

 filter (contains(?x,"كح") && contains(?x,"ناشف"))

in English

 filter (contains(?x," Cough  ") && contains(?x," dry  "))







On Mon, Jan 27, 2020 at 10:12 AM Lorenz Buehmann <[hidden email]> wrote:
And you tried what so far? I mean it's not the first SPARQL question
from you, so you should be able to just do this or not?

What's wrong with using a filter e.g.
FILTER(CONTAINS(str(?your_literal_var_here), "Cough dry")) ? Does this
not work for you?

On 26.01.20 22:37, duha wrote:
> I have a phrase consist of two words
> I need to write query find a word using filter contains and strstarts such
> as(Cough dry)
>
> or another way to find this ??
>
> Thanks
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: exmple for filter contains (sparql)

Lorenz Buehmann

Ok, but that's nothing you can solve with standard SPARQL. That's pure NLP and needs a fulltext engine like Lucene. Some triple stores like Apache Jena do support a Lucene backed fulltext search, i.e. you can use

SELECT ?s WHERE {

?s text:query(rdfs:label "cough dry")

}

and the Lucene query parser will do stemming for you in the same way the dataset was index.

But with standard SPARQL, no way.

On 27.01.20 09:35, Doha Hassan wrote:
without stemming, your solution works correctly and I tried this before I sent this email, the problem occurs when the dataset stemming or lemmatization and ontology without stemming.







On Mon, Jan 27, 2020 at 10:24 AM Doha Hassan <[hidden email]> wrote:
Thank you so much 

I 'm working in the Arabic language after steaming the word,, 
so I can't merge this 
I'm trying to do this, and its work correctly

 filter (contains(?x,"كح") && contains(?x,"ناشف"))

in English

 filter (contains(?x," Cough  ") && contains(?x," dry  "))







On Mon, Jan 27, 2020 at 10:12 AM Lorenz Buehmann <[hidden email]> wrote:
And you tried what so far? I mean it's not the first SPARQL question
from you, so you should be able to just do this or not?

What's wrong with using a filter e.g.
FILTER(CONTAINS(str(?your_literal_var_here), "Cough dry")) ? Does this
not work for you?

On 26.01.20 22:37, duha wrote:
> I have a phrase consist of two words
> I need to write query find a word using filter contains and strstarts such
> as(Cough dry)
>
> or another way to find this ??
>
> Thanks
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: exmple for filter contains (sparql)

duha
Inshallah, this is the final question,
How using (and operate) in the filter
filter ( ?x="رشح" || ?x="الصداع") like this ,, (OR operator ) is working correctly ,, what about And??

Note {{ filter ( ?x="رشح" && ?x="الصداع") }} doesn’t working

Regards

On Mon, Jan 27, 2020 at 11:14 AM Lorenz Buehmann <[hidden email]> wrote:

Ok, but that's nothing you can solve with standard SPARQL. That's pure NLP and needs a fulltext engine like Lucene. Some triple stores like Apache Jena do support a Lucene backed fulltext search, i.e. you can use

SELECT ?s WHERE {

?s text:query(rdfs:label "cough dry")

}

and the Lucene query parser will do stemming for you in the same way the dataset was index.

But with standard SPARQL, no way.

On 27.01.20 09:35, Doha Hassan wrote:
without stemming, your solution works correctly and I tried this before I sent this email, the problem occurs when the dataset stemming or lemmatization and ontology without stemming.







On Mon, Jan 27, 2020 at 10:24 AM Doha Hassan <[hidden email]> wrote:
Thank you so much 

I 'm working in the Arabic language after steaming the word,, 
so I can't merge this 
I'm trying to do this, and its work correctly

 filter (contains(?x,"كح") && contains(?x,"ناشف"))

in English

 filter (contains(?x," Cough  ") && contains(?x," dry  "))







On Mon, Jan 27, 2020 at 10:12 AM Lorenz Buehmann <[hidden email]> wrote:
And you tried what so far? I mean it's not the first SPARQL question
from you, so you should be able to just do this or not?

What's wrong with using a filter e.g.
FILTER(CONTAINS(str(?your_literal_var_here), "Cough dry")) ? Does this
not work for you?

On 26.01.20 22:37, duha wrote:
> I have a phrase consist of two words
> I need to write query find a word using filter contains and strstarts such
> as(Cough dry)
>
> or another way to find this ??
>
> Thanks
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: exmple for filter contains (sparql)

Lorenz Buehmann


On 30.01.20 01:41, Doha Hassan wrote:
Inshallah, this is the final question,
How using (and operate) in the filter
filter ( ?x="رشح" || ?x="الصداع") like this ,, (OR operator ) is working correctly ,, what about And??
Isn't that obvious?

Note {{ filter ( ?x="رشح" && ?x="الصداع") }} doesn’t working
That filter doesn't make sense, think one more time about it. Youre asking for equality here, not string containment. Obviously, a string literal can't equal to two different values, .e.g "a" and "b" ... makes sense, right? You have to use contains() or whatever, e.g. (filter(contains(str(?x), "a") && contains(str(?x), "b")) - otherwise, I don't know what you're trying to query.

Regards

On Mon, Jan 27, 2020 at 11:14 AM Lorenz Buehmann <[hidden email]> wrote:

Ok, but that's nothing you can solve with standard SPARQL. That's pure NLP and needs a fulltext engine like Lucene. Some triple stores like Apache Jena do support a Lucene backed fulltext search, i.e. you can use

SELECT ?s WHERE {

?s text:query(rdfs:label "cough dry")

}

and the Lucene query parser will do stemming for you in the same way the dataset was index.

But with standard SPARQL, no way.

On 27.01.20 09:35, Doha Hassan wrote:
without stemming, your solution works correctly and I tried this before I sent this email, the problem occurs when the dataset stemming or lemmatization and ontology without stemming.







On Mon, Jan 27, 2020 at 10:24 AM Doha Hassan <[hidden email]> wrote:
Thank you so much 

I 'm working in the Arabic language after steaming the word,, 
so I can't merge this 
I'm trying to do this, and its work correctly

 filter (contains(?x,"كح") && contains(?x,"ناشف"))

in English

 filter (contains(?x," Cough  ") && contains(?x," dry  "))







On Mon, Jan 27, 2020 at 10:12 AM Lorenz Buehmann <[hidden email]> wrote:
And you tried what so far? I mean it's not the first SPARQL question
from you, so you should be able to just do this or not?

What's wrong with using a filter e.g.
FILTER(CONTAINS(str(?your_literal_var_here), "Cough dry")) ? Does this
not work for you?

On 26.01.20 22:37, duha wrote:
> I have a phrase consist of two words
> I need to write query find a word using filter contains and strstarts such
> as(Cough dry)
>
> or another way to find this ??
>
> Thanks
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user