Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working example for importing and applying an ontology #131

Open
user121216 opened this issue Oct 17, 2018 · 4 comments
Open

Working example for importing and applying an ontology #131

user121216 opened this issue Oct 17, 2018 · 4 comments

Comments

@user121216
Copy link

Hello,

I'm trying to load a small ontology and to apply that on a prepared text file, but it's not working. The text file is indexed and searchable by fulltext but there is no interactive facet.

Can someone help with a working example to understand what is possible with the current implementation, e.g. pizza with a title and some credentials.

Thanks in advance!

PS: I want to annotate some html files to make them searchable by facets, e.g. <h1> tag with a defined owl class. Later it should be possible to search by text, e.g. pizzas with onions. :)

@YoannMR
Copy link

YoannMR commented Oct 17, 2018

Hello,

I'd be curious to know if you are able to make it work with an ontology.

We tried using ontologies but had to give up (it is looking for only a subset of synonyms keywords and the hierarchy is somehow flattened).

Instead, we created list of keywords from an ontology and imported the text file to tag documents. If you care about synonyms, that can be done using a text file as well with some minor modification of OSS's code.

Let me know how it goes for you.
Thanks

@user121216
Copy link
Author

So, it's not possible to add custom ontology classes like the facet ones (Person, Organizations, Content type), yet?

I tried to add a list of keywords but my tag list for tagging is still empty.
It would be nice to get another hint.

Thanks so far.

@YoannMR
Copy link

YoannMR commented Oct 18, 2018

Here is what worked for me on a Ubuntu 18.04 EC2 instance:

  • create a folder at root level (ex.: /test_folder )
  • create a text file containing the keywords you want to tag in your dictionary (ex.: equation.txt with text "equation = alpha * beta"
  • create a text file with the keywords from the dictionary (one key word per line, ex.:
    alpha
    beta
    iota
    ...
  • in OSS web UI, click on "Manage structure" at the top, then "interface for ontologies and lists", then "add new list of names or named entities...". Under "Upload", click on "choose file" and select the dictionary text file (ex.: greek_letter.txt). By memory, then click "save" and "apply ontology". It runs for a while and should tell you when it completed. You will then see the ontology file loaded in the ontology manager (see screenshot below)
    image

Adding an ontology that way should automatically tag your documents and you should now see a facet named "greek_letter.txt" with the tagged keyword appearing there. You can also add snippet to see tagged word under each documents (see screenshot below).

If your documents are not tagged, you could try reindexing them with command line (-f to force reindexing, -v for verbose to see what's going on)
opensemanticsearch-index-file /test_folder -f -v

image

I hope that helps!

@user121216
Copy link
Author

user121216 commented Oct 18, 2018

Thank you! It works.

I made a fundamental mistake. :) I added the keywords to html tags instead of readable text.

Now I will play around a little bit.

If somebody can help me with real ontologies, it would be nice. Otherwise the issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants