0

I have some data let us say:

"Mike": "flower"

I can use some owl ontologies or I can create my own ontology using Protege to convert this data to RDF triples to be as the following:

<http://some_URI/Mike> <http://DBpedia#likes> <http://some_URIflower>

The problem is that there are some tools that allow you to use an ontology for mapping row data to RDF, such as Karma and Protege. But the problem is that you ALWAYS have to map each entity or instance of a class at a time. For example, I had to map Mike to Flower and set the property between them.

Question: Is there a way or a tool that does the mapping for you automatically without mapping each entity at a time?

Simple JSON Input

{
    "001": {
        "caption": "Beautiful",
        "object": "Flower"
    },
    "002": {
        "caption": "white",
        "object": "ice"
    }
}

Mapping 001 and 002 instances using Karma enter image description here

So even though 001 and 002 are same instance of a class and same level in the json file but still I have to map every one alone. How to tell karma to map every item in the same level of 001 as I did with 001 ? (I am talking about thousands of instances not only 2).

Desired output:

<001> <caption> "Beautiful"
<002> <caption> "white"
ananya
  • 879
  • 1
  • 7
  • 14
  • Are you thinking of a tool that, given one assertion, e.g., `?X likes ?Y` also adds other properties to all variable matches for ?X and ?Y? One way could be with SWRL rules, another way with SPARQL construct queries, but both require a basic mapping from the data to an ontology/RDF file to which reasoning or SPARQL queries can be applied. Otherwise I'm not sure if it's possible to write a general tool that does this kind of work. – Ignazio Sep 12 '18 at 22:46
  • That's not true. Karma is a mapping tool that allows you to convert CSV, SQL database etc. to RDF resp. OWL. The only thing you have to map is e.g. columns of a CSV file or columns of a database. Each row will converted then automatically to a set of triples (resp. OWL axioms). – UninformedUser Sep 13 '18 at 06:03
  • Any CSV to RDF tool should do what you need. Probably MappingMaster or Cellfie both available as Protege plugins. – UninformedUser Sep 13 '18 at 06:04
  • @AKSW Thank you. You are right, and I have been doing like this with Karma so far. But what if you have JSON file instead of CSV columns. Then you have to map thousands of columns because once you upload the json file, every `key: value` and their derived `key:value` will be considered different columns and different classes. So is there a way to tell Karma every key in this json file is the same class instance ? So I want to map the rest of the keys same as the first key ? I edited the question and added a picture (Thanks in advanced) – ananya Sep 13 '18 at 17:17
  • You can try to convert your JSON file to JSON-LD. If the structure is simple, it shouldn't be so difficult. As an example, see [here](https://etl.linkedpipes.com/tutorials/how-to/map_json_to_rdf). hope this helps – UninformedUser Sep 15 '18 at 10:31

0 Answers0