Skip to content

🐛 Issue #37 #89

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

Merged
merged 6 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
🐛 Issue #37
  • Loading branch information
ferzcam committed Nov 19, 2024
commit dcfb64cef74cc1f86301b26c4ce6f2c93202601b
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@
copyright = '2023, Bio-Ontology Research Group'
author = 'BORG'

release = '1.0.1'
version = '1.0.1'
release = '1.0.2-dev'
version = '1.0.2-dev'
# -- General configuration

extensions = [
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ Getting started
**mOWL** can be installed from `source code <https://github.com/bio-ontology-research-group/mowl>`_ or from `PyPi <https://pypi.org/project/mowl-borg/>`_. For more details on installation check out the how to :doc:`install/index` section of the project.

.. note::
This version of documentation corresponds to mOWL-1.0.1.
This version of documentation corresponds to mOWL-1.0.2-dev.


mOWL, JPype and the JVM
11 changes: 7 additions & 4 deletions mowl/projection/edge.py
Original file line number Diff line number Diff line change
@@ -69,14 +69,15 @@ def getEntitiesAndRelations(edges):
return Edge.get_entities_and_relations(edges)

@staticmethod
@versionchanged(version="1.0.2", reason="Method return type changed to tuple of lists")
def get_entities_and_relations(edges):
'''
:param edges: list of edges
:type edges: :class:`Edge`
:returns: Returns a 2-tuple containing the list of entities (heads and tails) and the \
list of relations
:rtype: (Set of str, Set of str)
:rtype: (list of str, list of str)
'''

entities = set()
@@ -86,6 +87,9 @@ def get_entities_and_relations(edges):
entities |= {edge.src, edge.dst}
relations |= {edge.rel}

entities = sorted(list(entities))
relations = sorted(list(relations))

return (entities, relations)

@staticmethod
@@ -109,12 +113,11 @@ def as_pykeen(edges, create_inverse_triples=True, entity_to_id=None, relation_to
"""
if entity_to_id is None or relation_to_id is None:
classes, relations = Edge.getEntitiesAndRelations(edges)
classes, relations = set(classes), set(relations)

if entity_to_id is None:
entity_to_id = {v: k for k, v in enumerate(list(classes))}
entity_to_id = {v: k for k, v in enumerate(classes)}
if relation_to_id is None:
relation_to_id = {v: k for k, v in enumerate(list(relations))}
relation_to_id = {v: k for k, v in enumerate(relations)}

def map_edge(edge):
return [entity_to_id[edge.src], relation_to_id[edge.rel], entity_to_id[edge.dst]]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

setuptools.setup(
name="mowl-borg",
version="1.0.2-dev.1",
version="1.0.2-dev.2",
author="Bio-Ontology Research Group",
author_email="[email protected]",
description="mOWL: A machine learning library with ontologies",
Loading