Reputation: 434
Having just started out in RDF and ontology, mainly in converting unstructured text to RDF (maybe manually), I found many examples for converting simple sentences to RDF triples 1 2 3, but not much about complex sentences (using adjectives or adverbs) 4.
Example of complex sentence: Those kids who, with great pleasure, like chocolate ice-cream and those who like vanilla ice-cream, which of them is better?
Never mind the meaning of the sentence, what is remarkable is the use of adjectives for ice-cream (chocolate, vanilla) and liking (with pleasure), and the comparison between the two types of kids (who is better) and a question. How do we represent such sentences as a collection of SPO triple (RDF) statements - so that it can take care of adjectives, or adverbs or comparisons or other operations?
S1: Kids - Liking - (ice-cream, flavor, Chocolate)
S2: Kids - Liking - (ice-cream, flavor, Vanilla)
S3: liking with pleasure
S4: better(S1+S3, S2+S3)
Is there a general way to approach translating such statements?Where should one look for some exploration in this direction - unstructured text to n-tuples? Maybe I am not asking the right questions - in that case please let me know. Thanks!
Upvotes: 4
Views: 969
Reputation: 2647
Far from attempting to describe a gneric way for translating such statements I thought of how that concrete example sentence could be modelled in RDF triples.
That's my first (late night) draft:
@prefix : <https://example.org/> .
[] a :Question, :PreferenceQuestion;
:option [
a :GroupOfHumans;
:ageGroup :young;
:perfomingActivity [
a :Activity, :LikingActivity;
:mode :withPleasure;
:object [
:category :IceCream;
:flavour :vanilla;
]
]
],
[
a :GroupOfHumans;
:ageGroup :young;
:perfomingActivity [
a :Activity, :LikingActivity;
:mode :withPleasure;
:object [
:category :IceCream;
:flavour :chocolate;
]
]
].
This would be 23 triples using quite an expressive Question/Activity/IceCream ontology.
Upvotes: 2
Reputation: 7873
That is a very difficult question that you are asking, there is not a single way to represent "semantic" in a graphical or tree or linkage structure that is definitive standard.
Look for instance at Google syntax parse, Link Grammar, Spacy dependency parse trees or Stanford NLP parser.
See this question that is somewhat related, gives an example of link grammar parse result: How to translate syntatic parse to a dependency parse tree?
For more advanced approaches look at multinet and natural language to first-order-logic kind of approaches.
Where should one look for some exploration in this direction - unstructured text to n-tuples?
You can represent what ever you want with n-tuples or 3-tuples, the thing is to know what and how to represent.
Last thing, you can come up with you are annotations, they are tools to do it like https://prodi.gy/. Have a look at this question that is seemingly unrelated but I give an example representation of questions that might help you achieve some task https://stackoverflow.com/a/32670572/140837
Good luck!!
Upvotes: 3