Repository: pykeen/pykeen
Issue: Does the create_inverse_triples uses the same relationship type?
GitHub labels: question

### What is your question

When you use create_inverse_triples in the TripleFactory, for example the following example:

```python
tf = TriplesFactory.from_labeled_triples(
  data[["source", "type", "target"]].values,
  create_inverse_triples=False,
  entity_to_id=None,
  relation_to_id=None,
  compact_id=False,
  filter_out_candidate_inverse_relations=True,
  metadata=None,
)
```

Do the inverted triples have the same relationship type, and you are in essence making the graph undirected or is it also an inverse relationship type like-> Manager : inverse would be Managed by

Thanks

### Environment

| Key             | Value                    |
|-----------------|--------------------------|
| OS              | posix                    |
| Platform        | Linux                    |
| Release         | 5.11.0-41-generic        |
| Time            | Sat Dec 11 17:36:58 2021 |
| Python          | 3.8.8                    |
| PyKEEN          | 1.6.0                    |
| PyKEEN Hash     | UNHASHED                 |
| PyKEEN Branch   |                          |
| PyTorch         | 1.9.0+cu102              |
| CUDA Available? | false                    |
| CUDA Version    | 10.2                     |
| cuDNN Version   | 7605                     |


### Issue Template Checks

- [X] This is not a bug report (use a different issue template if it is)
- [X] This is not a feature request (use a different issue template if it is)
- [X] I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed

Thanks for opening a new issue, I didn't mean to be rude, but we lose a lot of time to people putting insufficient information in issues and we're just now trying out GitHub's new issue template to help submitters give sufficient information.

The metadata that inverse triples should be created are stored in the `pykeen.triples.triples_factory.TriplesFactory`, but the various classes in `pykeen.triples.instances` are where they actually get materialized.

Ultimately, each inverse triple gets a unique relation index and the directedness of the graph is maintained. However, we don't do any introspection on the names to generate meaningful labels for the inverse relations. Notably, if a graph already contains inverse relations (manager / managed by) then you will get some duplication, since PyKEEN isn't itself aware of the schema of the input (except for this minimal `filter_out_candidate_inverse_relations` flag). We have built a few utilities for looking for stuff like this and inferring schema, but they're not super accessible at the moment

Sure, no worries.
Thanks for the swift response and thanks for developing such an awesome and easy to use library. I've just written a blog post that shows how to integrate it with Neo4j, I'll tag you on social media once it's published.

Thanks again!

That's fabulous! Looking forwards to it :) 


Edit: see here https://towardsdatascience.com/knowledge-graph-completion-with-pykeen-and-neo4j-6bca734edf43