Re: Data or Object properties as String value

2017-08-07 Thread javed khan
Ok thanks a lot Lorenz.


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Mon, Aug 7, 2017 at 10:59 AM, Lorenz Buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> On 06.08.2017 13:14, javed khan wrote:
> > **The better way would be to add labels for the resources and search in
> > the labels instead.**
> >
> > By label you mean rdfs:label?  In that case, how it can be searched then
> > when user provide their inputs via UI i-e a text field in my case.?
> Ehm, simply using the FILTER on the label value?!
> >
> >  source=link_campaign=sig-email_content=webmail_term=icon>
> > Virus-free.
> > www.avast.com
> >  source=link_campaign=sig-email_content=webmail_term=link>
> > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> > On Sun, Aug 6, 2017 at 1:23 PM, Lorenz B. <
> > buehm...@informatik.uni-leipzig.de> wrote:
> >
> >> Then you have to use a REGEX (or CONTAINS - not sure how you want to
> >> match) in the FILTER and search in the String of the URI
> >>
> >> FILTER(REGEX(STR(?var), "TOKEN"))
> >>
> >>
> >> But in general that's bad practice for sure.
> >>
> >> The better way would be to add labels for the resources and search in
> >> the labels instead.
> >>
> >>> Lorenz yes I know object properties connect resources of two classes
> and
> >> it
> >>> must be URIs..
> >>>
> >>> In our ontology we have object property "hasPublications" which has
> >> domain
> >>> Person and range Publication class (Publication instances can be a
> Book,
> >>> Paper or Article) . Users need to type a person publication by typing
> its
> >>> name in a text box "Cloud computing security"  and we have to find it.
> >>>
> >>> So in that case in order to use it as Filter in query, we need to use
> >> both
> >>> object property and data property like
> >>>
> >>>  Person hasPublications somepublication   and then data property as
> >> string
> >>>  publicationName "String value"
> >>>
> >>> On Sat, Aug 5, 2017 at 10:49 AM, Lorenz B. <
> >>> buehm...@informatik.uni-leipzig.de> wrote:
> >>>
> > For example, if we have to use filter keyword with a java variable
>  (filter
> > ?var='javaVariable) in our semantic web application, is it mandatory
> to
>  use
> > it as "data property" in our ontology and use it as String type?
>  Obviously, but it depends on the content of javaVariable ... you can
>  also compare other datatypes like int, double, etc. and for some you
>  have to provide the datatype explcitely, i.e. "VALUE"^^
>  But yes, if it would be an object property you have to use a URI - I
>  hope this is clear, this is very basic Semantic Web knowledge, you
>  should already know that object properties "connect" resources which
> are
>  denoted by URIs.
> > Like, name as data property in the ontology and then we use in our
>  (SPARQL
> > Filter) query when a user enter the name in a text box.
> >
> > Some time we need some object properties (as string) to use it as
> >> filter
>  in
> > our queries.
> >
> >
> >   source=link_campaign=sig-email_content=webmail_term=icon>
> > Virus-free.
> > www.avast.com
> >   source=link_campaign=sig-email_content=webmail_term=link>
> > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
>  --
>  Lorenz Bühmann
>  AKSW group, University of Leipzig
>  Group: http://aksw.org - semantic web research center
> 
> 
> >> --
> >> Lorenz Bühmann
> >> AKSW group, University of Leipzig
> >> Group: http://aksw.org - semantic web research center
> >>
> >>
>
>


Re: Data or Object properties as String value

2017-08-07 Thread Lorenz Buehmann


On 06.08.2017 13:14, javed khan wrote:
> **The better way would be to add labels for the resources and search in
> the labels instead.**
>
> By label you mean rdfs:label?  In that case, how it can be searched then
> when user provide their inputs via UI i-e a text field in my case.?
Ehm, simply using the FILTER on the label value?!
>
> 
> Virus-free.
> www.avast.com
> 
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Sun, Aug 6, 2017 at 1:23 PM, Lorenz B. <
> buehm...@informatik.uni-leipzig.de> wrote:
>
>> Then you have to use a REGEX (or CONTAINS - not sure how you want to
>> match) in the FILTER and search in the String of the URI
>>
>> FILTER(REGEX(STR(?var), "TOKEN"))
>>
>>
>> But in general that's bad practice for sure.
>>
>> The better way would be to add labels for the resources and search in
>> the labels instead.
>>
>>> Lorenz yes I know object properties connect resources of two classes and
>> it
>>> must be URIs..
>>>
>>> In our ontology we have object property "hasPublications" which has
>> domain
>>> Person and range Publication class (Publication instances can be a Book,
>>> Paper or Article) . Users need to type a person publication by typing its
>>> name in a text box "Cloud computing security"  and we have to find it.
>>>
>>> So in that case in order to use it as Filter in query, we need to use
>> both
>>> object property and data property like
>>>
>>>  Person hasPublications somepublication   and then data property as
>> string
>>>  publicationName "String value"
>>>
>>> On Sat, Aug 5, 2017 at 10:49 AM, Lorenz B. <
>>> buehm...@informatik.uni-leipzig.de> wrote:
>>>
> For example, if we have to use filter keyword with a java variable
 (filter
> ?var='javaVariable) in our semantic web application, is it mandatory to
 use
> it as "data property" in our ontology and use it as String type?
 Obviously, but it depends on the content of javaVariable ... you can
 also compare other datatypes like int, double, etc. and for some you
 have to provide the datatype explcitely, i.e. "VALUE"^^
 But yes, if it would be an object property you have to use a URI - I
 hope this is clear, this is very basic Semantic Web knowledge, you
 should already know that object properties "connect" resources which are
 denoted by URIs.
> Like, name as data property in the ontology and then we use in our
 (SPARQL
> Filter) query when a user enter the name in a text box.
>
> Some time we need some object properties (as string) to use it as
>> filter
 in
> our queries.
>
>
> 
> Virus-free.
> www.avast.com
> 
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
 --
 Lorenz Bühmann
 AKSW group, University of Leipzig
 Group: http://aksw.org - semantic web research center


>> --
>> Lorenz Bühmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>>



Re: Data or Object properties as String value

2017-08-06 Thread Lorenz B.
Then you have to use a REGEX (or CONTAINS - not sure how you want to
match) in the FILTER and search in the String of the URI

FILTER(REGEX(STR(?var), "TOKEN"))


But in general that's bad practice for sure.

The better way would be to add labels for the resources and search in
the labels instead.

> Lorenz yes I know object properties connect resources of two classes and it
> must be URIs..
>
> In our ontology we have object property "hasPublications" which has domain
> Person and range Publication class (Publication instances can be a Book,
> Paper or Article) . Users need to type a person publication by typing its
> name in a text box "Cloud computing security"  and we have to find it.
>
> So in that case in order to use it as Filter in query, we need to use both
> object property and data property like
>
>  Person hasPublications somepublication   and then data property as string
>  publicationName "String value"
>
> On Sat, Aug 5, 2017 at 10:49 AM, Lorenz B. <
> buehm...@informatik.uni-leipzig.de> wrote:
>
>>
>>> For example, if we have to use filter keyword with a java variable
>> (filter
>>> ?var='javaVariable) in our semantic web application, is it mandatory to
>> use
>>> it as "data property" in our ontology and use it as String type?
>> Obviously, but it depends on the content of javaVariable ... you can
>> also compare other datatypes like int, double, etc. and for some you
>> have to provide the datatype explcitely, i.e. "VALUE"^^
>> But yes, if it would be an object property you have to use a URI - I
>> hope this is clear, this is very basic Semantic Web knowledge, you
>> should already know that object properties "connect" resources which are
>> denoted by URIs.
>>> Like, name as data property in the ontology and then we use in our
>> (SPARQL
>>> Filter) query when a user enter the name in a text box.
>>>
>>> Some time we need some object properties (as string) to use it as filter
>> in
>>> our queries.
>>>
>>>
>>> > source=link_campaign=sig-email_content=webmail_term=icon>
>>> Virus-free.
>>> www.avast.com
>>> > source=link_campaign=sig-email_content=webmail_term=link>
>>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>> --
>> Lorenz Bühmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center



Re: Data or Object properties as String value

2017-08-05 Thread Martynas Jusevičius
I think you might be confusing literal datatypes in RDF/SPARQL and
object/datatype properties in OWL.

You don't need an ontology to be able to run a query. Just make sure
datatypes in your query match your data.

If you need to define your domain in an ontology, then you need to define
properties and sort them into object/datatype ones, again depending on how
you used them in your data.

My point is, it's not very useful to use ontology terms when talking about
queries.


On Sat, 5 Aug 2017 at 12.13, javed khan  wrote:

> Lorenz yes I know object properties connect resources of two classes and it
> must be URIs..
>
> In our ontology we have object property "hasPublications" which has domain
> Person and range Publication class (Publication instances can be a Book,
> Paper or Article) . Users need to type a person publication by typing its
> name in a text box "Cloud computing security"  and we have to find it.
>
> So in that case in order to use it as Filter in query, we need to use both
> object property and data property like
>
>  Person hasPublications somepublication   and then data property as string
>  publicationName "String value"
>
> On Sat, Aug 5, 2017 at 10:49 AM, Lorenz B. <
> buehm...@informatik.uni-leipzig.de> wrote:
>
> >
> >
> > > For example, if we have to use filter keyword with a java variable
> > (filter
> > > ?var='javaVariable) in our semantic web application, is it mandatory to
> > use
> > > it as "data property" in our ontology and use it as String type?
> > Obviously, but it depends on the content of javaVariable ... you can
> > also compare other datatypes like int, double, etc. and for some you
> > have to provide the datatype explcitely, i.e. "VALUE"^^
> > But yes, if it would be an object property you have to use a URI - I
> > hope this is clear, this is very basic Semantic Web knowledge, you
> > should already know that object properties "connect" resources which are
> > denoted by URIs.
> > >
> > > Like, name as data property in the ontology and then we use in our
> > (SPARQL
> > > Filter) query when a user enter the name in a text box.
> > >
> > > Some time we need some object properties (as string) to use it as
> filter
> > in
> > > our queries.
> > >
> > >
> > >  > source=link_campaign=sig-email_content=webmail_term=icon>
> > > Virus-free.
> > > www.avast.com
> > >  > source=link_campaign=sig-email_content=webmail_term=link>
> > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> > >
> > --
> > Lorenz Bühmann
> > AKSW group, University of Leipzig
> > Group: http://aksw.org - semantic web research center
> >
> >
>


Re: Data or Object properties as String value

2017-08-05 Thread javed khan
Lorenz yes I know object properties connect resources of two classes and it
must be URIs..

In our ontology we have object property "hasPublications" which has domain
Person and range Publication class (Publication instances can be a Book,
Paper or Article) . Users need to type a person publication by typing its
name in a text box "Cloud computing security"  and we have to find it.

So in that case in order to use it as Filter in query, we need to use both
object property and data property like

 Person hasPublications somepublication   and then data property as string
 publicationName "String value"

On Sat, Aug 5, 2017 at 10:49 AM, Lorenz B. <
buehm...@informatik.uni-leipzig.de> wrote:

>
>
> > For example, if we have to use filter keyword with a java variable
> (filter
> > ?var='javaVariable) in our semantic web application, is it mandatory to
> use
> > it as "data property" in our ontology and use it as String type?
> Obviously, but it depends on the content of javaVariable ... you can
> also compare other datatypes like int, double, etc. and for some you
> have to provide the datatype explcitely, i.e. "VALUE"^^
> But yes, if it would be an object property you have to use a URI - I
> hope this is clear, this is very basic Semantic Web knowledge, you
> should already know that object properties "connect" resources which are
> denoted by URIs.
> >
> > Like, name as data property in the ontology and then we use in our
> (SPARQL
> > Filter) query when a user enter the name in a text box.
> >
> > Some time we need some object properties (as string) to use it as filter
> in
> > our queries.
> >
> >
> >  source=link_campaign=sig-email_content=webmail_term=icon>
> > Virus-free.
> > www.avast.com
> >  source=link_campaign=sig-email_content=webmail_term=link>
> > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>


Re: Data or Object properties as String value

2017-08-05 Thread Lorenz B.


> For example, if we have to use filter keyword with a java variable (filter
> ?var='javaVariable) in our semantic web application, is it mandatory to use
> it as "data property" in our ontology and use it as String type?
Obviously, but it depends on the content of javaVariable ... you can
also compare other datatypes like int, double, etc. and for some you
have to provide the datatype explcitely, i.e. "VALUE"^^
But yes, if it would be an object property you have to use a URI - I
hope this is clear, this is very basic Semantic Web knowledge, you
should already know that object properties "connect" resources which are
denoted by URIs.
>
> Like, name as data property in the ontology and then we use in our (SPARQL
> Filter) query when a user enter the name in a text box.
>
> Some time we need some object properties (as string) to use it as filter in
> our queries.
>
>
> 
> Virus-free.
> www.avast.com
> 
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center



Data or Object properties as String value

2017-08-04 Thread javed khan
For example, if we have to use filter keyword with a java variable (filter
?var='javaVariable) in our semantic web application, is it mandatory to use
it as "data property" in our ontology and use it as String type?

Like, name as data property in the ontology and then we use in our (SPARQL
Filter) query when a user enter the name in a text box.

Some time we need some object properties (as string) to use it as filter in
our queries.



Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>