You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Laura Morales <la...@mail.com> on 2021/04/29 12:27:40 UTC

Terms context

I have problems with the fact that, in English, words can have multiple meanings and can also be used as verbs, nouns, etc. In RDF, I feel like I'm compelled to define a term and its one meaning that is unique across the entire vocabulary. If I want to use the same term to mean two or more things, I have to use two dictionaries or I have to come up with weird combinations of multiple words. You know, like SimpleBeanFactoryAwareAspectInstanceFactory.
I was wondering if there is any way to define a term whose meaning depends on the context. For example Lorem.foobar and Ipsum.foobar, "foobar" could mean two entirely different things depending on whether it's a property of the type Lorem or type Ipsum. AFAIK OWL defines domains/ranges for terms, so maybe these can be used for this goal? What would be the practical implications, for example if I were to use Fuseki without an OWL reasoner (ie. just by loading a bunch of triples and start querying with SPARQL)?

Re: Terms context

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
This lemon lexicon model could be useful: 
https://www.w3.org/2016/05/ontolex/

On 29/04/2021 15.27, Laura Morales wrote:
> I have problems with the fact that, in English, words can have multiple meanings and can also be used as verbs, nouns, etc. In RDF, I feel like I'm compelled to define a term and its one meaning that is unique across the entire vocabulary. If I want to use the same term to mean two or more things, I have to use two dictionaries or I have to come up with weird combinations of multiple words. You know, like SimpleBeanFactoryAwareAspectInstanceFactory.
> I was wondering if there is any way to define a term whose meaning depends on the context. For example Lorem.foobar and Ipsum.foobar, "foobar" could mean two entirely different things depending on whether it's a property of the type Lorem or type Ipsum. AFAIK OWL defines domains/ranges for terms, so maybe these can be used for this goal? What would be the practical implications, for example if I were to use Fuseki without an OWL reasoner (ie. just by loading a bunch of triples and start querying with SPARQL)?

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: Terms context

Posted by aj...@apache.org.
If you are interested ultimately in how the data looks (syntax) and if you
can use JSON-LD to transport the data, there are some features in JSON-LD
1.1 that might help:

https://www.w3.org/TR/json-ld11/#aliasing-keywords

https://www.w3.org/TR/json-ld11/#scoped-contexts

Adam


On Thu, Apr 29, 2021, 8:27 AM Laura Morales <la...@mail.com> wrote:

> I have problems with the fact that, in English, words can have multiple
> meanings and can also be used as verbs, nouns, etc. In RDF, I feel like I'm
> compelled to define a term and its one meaning that is unique across the
> entire vocabulary. If I want to use the same term to mean two or more
> things, I have to use two dictionaries or I have to come up with weird
> combinations of multiple words. You know, like
> SimpleBeanFactoryAwareAspectInstanceFactory.
> I was wondering if there is any way to define a term whose meaning depends
> on the context. For example Lorem.foobar and Ipsum.foobar, "foobar" could
> mean two entirely different things depending on whether it's a property of
> the type Lorem or type Ipsum. AFAIK OWL defines domains/ranges for terms,
> so maybe these can be used for this goal? What would be the practical
> implications, for example if I were to use Fuseki without an OWL reasoner
> (ie. just by loading a bunch of triples and start querying with SPARQL)?
>

Re: Terms context

Posted by Alexis Armin Huf <al...@gmail.com>.
IMHO, to have different meanings in RDF, you need two different IRIs. Two
meanings in the same IRI is only possible if the "meaning" resides on
people's minds.

However, one possible solution would to *store* in RDF:
:Alice :phys_address "Some st., no 23, Miami, FL, USA".
:Bob :email_address "bob@example.com" .
Then, in an ontology you could have:
:email_address rdfs:subPropertyOf :address .
:phys_address rdfs:subPropertyOf :address .
Then, with reasoning enabled, you could query:
SELECT * WHERE {
    ?who :address ?where
} LIMIT 10
You could also do the other way around, store :address triples and then use
rules (just reasoning will soon not be sufficient) to infer the more
specific properties. This strategy can also work for implementing the
multiple meanings for classes.

Note that reasoning in production might not be really pleasant in the speed
aspect. You may want to materialize the entailments using an external
reasoner and them load the entailed RDF into Jena for querying. I've used
vlog <https://github.com/karmaresearch/vlog/> recently with really good
performance, but its interface is not friendly.

On Thu, Apr 29, 2021 at 3:16 PM Laura Morales <la...@mail.com> wrote:

> > Can you use subproperties?
> >
> > One point of RDF is to avoid collisions do data can be merged safely.
>
> I don't think subproperties are the answer. My problem is that the meaning
> of a property is defined within the boundaries of the whole vocabulary,
> whereas I'd like the meaning to be defined within the boundaries of its
> "neighborhood" context. If it makes sense.
> For example I could have two classes, RealFriend.address and
> VirtualFriend.address. Here I'd like "address" to mean 2 different things
> (physical address, email address) depending on the local context, ie.
> RealFriend vs VirtualFriend. Of course I can use multiple vocabularies, or
> I can rename them phys_address/email_address; but I hope the example is not
> too trivial and that you can understand what I mean.
>


-- 
Alexis Armin Huf <al...@gmail.com>

Re: Terms context

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
If you have compound property names such as RealFriend.address and
VirtualFriend.address, it’s a good indication that you should split up the
relationship and make the address a standalone resource. Then you can reuse
the address property for both cases. Which gives

_:friend1 a :VirtualFriend ;
    :address [ a :VirtualAddress ; foaf:mbox <> ] .

_:friend2 a :PhysicalFriend ;
    :address [ a :PhysicalAddress ; :street_name “...” ] .

and then probably

:VirtualAddress rdfs:subClassOf :Address .
:PhysicalAddress rdfs:subClassOf :Address .

:address rdfs:range :Address .

I think that matches your description quite closely.

On Thu, 29 Apr 2021 at 20.16, Laura Morales <la...@mail.com> wrote:

> > Can you use subproperties?
> >
> > One point of RDF is to avoid collisions do data can be merged safely.
>
> I don't think subproperties are the answer. My problem is that the meaning
> of a property is defined within the boundaries of the whole vocabulary,
> whereas I'd like the meaning to be defined within the boundaries of its
> "neighborhood" context. If it makes sense.
> For example I could have two classes, RealFriend.address and
> VirtualFriend.address. Here I'd like "address" to mean 2 different things
> (physical address, email address) depending on the local context, ie.
> RealFriend vs VirtualFriend. Of course I can use multiple vocabularies, or
> I can rename them phys_address/email_address; but I hope the example is not
> too trivial and that you can understand what I mean.
>

Re: Terms context

Posted by Laura Morales <la...@mail.com>.
> Can you use subproperties?
>
> One point of RDF is to avoid collisions do data can be merged safely.

I don't think subproperties are the answer. My problem is that the meaning of a property is defined within the boundaries of the whole vocabulary, whereas I'd like the meaning to be defined within the boundaries of its "neighborhood" context. If it makes sense.
For example I could have two classes, RealFriend.address and VirtualFriend.address. Here I'd like "address" to mean 2 different things (physical address, email address) depending on the local context, ie. RealFriend vs VirtualFriend. Of course I can use multiple vocabularies, or I can rename them phys_address/email_address; but I hope the example is not too trivial and that you can understand what I mean.

Re: Terms context

Posted by Andy Seaborne <an...@apache.org>.

On 29/04/2021 13:27, Laura Morales wrote:
> I have problems with the fact that, in English, words can have multiple meanings and can also be used as verbs, nouns, etc. In RDF, I feel like I'm compelled to define a term and its one meaning that is unique across the entire vocabulary. If I want to use the same term to mean two or more things, I have to use two dictionaries or I have to come up with weird combinations of multiple words. You know, like SimpleBeanFactoryAwareAspectInstanceFactory.
> I was wondering if there is any way to define a term whose meaning depends on the context. For example Lorem.foobar and Ipsum.foobar, "foobar" could mean two entirely different things depending on whether it's a property of the type Lorem or type Ipsum. AFAIK OWL defines domains/ranges for terms, so maybe these can be used for this goal? What would be the practical implications, for example if I were to use Fuseki without an OWL reasoner (ie. just by loading a bunch of triples and start querying with SPARQL)?
> 

Can you use subproperties?

One point of RDF is to avoid collisions do data can be merged safely.

----

Domain.and range - if there are two declarations then, just like any two 
triples, they are both true, not an either-or.

:p rdfs:domain :C .
:p rdfs:domain :D .
:x :p 123 .
=>
:x a :C , :D


Re: Terms context

Posted by graham <gr...@orangedogsoftware.com>.
Hi

Can you give a more detailed example of where you think having two 
different meanings for foobar causes a problem when using RDF?

I do something similar regularly in RDF, without issue. At least I think 
I do, but maybe I am misunderstanding you.

For example when querying I often write queries that contain something 
like this

     ?x a Lorem

     ?x foobar ?y

  In other words when querying I am explicit about my context.

graham

On 30/04/21 12:27 am, Laura Morales wrote:
> I have problems with the fact that, in English, words can have multiple meanings and can also be used as verbs, nouns, etc. In RDF, I feel like I'm compelled to define a term and its one meaning that is unique across the entire vocabulary. If I want to use the same term to mean two or more things, I have to use two dictionaries or I have to come up with weird combinations of multiple words. You know, like SimpleBeanFactoryAwareAspectInstanceFactory.
> I was wondering if there is any way to define a term whose meaning depends on the context. For example Lorem.foobar and Ipsum.foobar, "foobar" could mean two entirely different things depending on whether it's a property of the type Lorem or type Ipsum. AFAIK OWL defines domains/ranges for terms, so maybe these can be used for this goal? What would be the practical implications, for example if I were to use Fuseki without an OWL reasoner (ie. just by loading a bunch of triples and start querying with SPARQL)?

-- 
     Doubt is a pain too lonely to know that faith is his twin brother. - Kahlil Gibran