# How to delete inserted data only but not model ontology?

**URL:** <https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445>\
**Category:** Support\
**Created:** [January 7, 2022, 3:03pm UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445 "2022-01-07T15:03:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [January 7, 2022, 3:03pm UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445/1 "2022-01-07T15:03:53Z")

</div>

I am inserting triples into a graph (not the default one) via HTTP API. I have also created classes in Studio - I can see them in Text Editor.

But when I issue:

```auto
PREFIX ...
CLEAR GRAPH atk:graph

```

both data and model classes are gone.

- How do I delete just the data from atk:grph?

Thanks,  
Radu

---

<div class="post-metadata">

**Author:** ![zorgoz](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zorgoz/32/1166_2.png) [@zorgoz](https://community.stardog.com/u/zorgoz)\
**Post date:** [January 7, 2022, 3:38pm UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445/2 "2022-01-07T15:38:58Z")

</div>

As far as I see, as both might contain blank nodes, which are quite cumbersome to delete, I suggest separating the data from the model into two different graphs.

---

<div class="post-metadata">

**Author:** ![serge](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/serge/32/376_2.png) [@serge](https://community.stardog.com/u/serge)\
**Post date:** [January 7, 2022, 4:15pm UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445/3 "2022-01-07T16:15:08Z")

</div>

I second keeping the ontology in its own graph.

---

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [January 10, 2022, 2:54pm UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445/4 "2022-01-10T14:54:24Z")

</div>

Hm .. that doesn't make sense - dat in one graph and ontology in a different graph?

How will data get its types?

Example please.

Thank you,  
Radu

---

<div class="post-metadata">

**Author:** ![zorgoz](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zorgoz/32/1166_2.png) [@zorgoz](https://community.stardog.com/u/zorgoz)\
**Post date:** [January 11, 2022, 11:51am UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445/5 "2022-01-11T11:51:58Z")

</div>

No problem with that. In most cases just need to query from your "data" graph - in some cases, you will need to additional FROM or FROM NAMED. However, the edges will be followed into any other graph.  
For some cases of visualization in Studio, you might need to switch to "stardog:context:named" or "stardog:context:all".

Model and data:

```auto
:model {
    :MyClass a owl:Class.
    :myProperty a owl:DataProperty;
}

:data {
    :x1 a :MyClass; :myProperty "123"^^xsd:integer.
}

```

Query:

```auto
select * from :data {?s a :MyClass; :myProperty ?o}

```

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/7/73ca43d252073576ab938c6b0fbcf69714c80815.png)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [January 25, 2022, 11:52am UTC](https://community.stardog.com/t/how-to-delete-inserted-data-only-but-not-model-ontology/3445/6 "2022-01-25T11:52:37Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
