Skip to content

Commit dbd6db7

Browse files
authored
Merge pull request #255 from DerwenAI/prep-0.6.1
minor fixes to resolve warnings; prep release
2 parents ba68a0f + 39164d6 commit dbd6db7

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ For detailed instructions please see:
158158
</details>
159159

160160

161+
<details>
162+
<summary>License and Copyright</summary>
163+
164+
Source code for **kglab** plus its logo, documentation, and examples
165+
have an [MIT license](https://spdx.org/licenses/MIT.html) which is
166+
succinct and simplifies use in commercial applications.
167+
168+
All materials herein are Copyright &copy; 2020-2022 Derwen, Inc.
169+
</details>
170+
171+
161172
<details>
162173
<summary>Attribution</summary>
163174
Please use the following BibTeX entry for citing **kglab** if you use
@@ -177,22 +188,14 @@ this library.
177188
```
178189
</details>
179190

191+
180192
<img
181193
alt="illustration of a knowledge graph, plus laboratory glassware"
182194
src="https://raw.githubusercontent.com/DerwenAI/kglab/main/docs/assets/logo.png"
183195
width="231"
184196
/>
185197

186198

187-
## License and Copyright
188-
189-
Source code for **kglab** plus its logo, documentation, and examples
190-
have an [MIT license](https://spdx.org/licenses/MIT.html) which is
191-
succinct and simplifies use in commercial applications.
192-
193-
All materials herein are Copyright &copy; 2020-2022 Derwen, Inc.
194-
195-
196199
## Kudos
197200

198201
Many thanks to our open source [sponsors](https://github.com/sponsors/ceteri);
@@ -228,4 +231,3 @@ and
228231
alt="kglab contributors"
229232
src="https://contributors-img.web.app/image?repo=derwenai/kglab"
230233
/>
231-

changelog.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
## 0.6.1
44

5-
2022-04-??
5+
2022-04-20
66

77
* automated RDF tests, coordinated with `Oxigraph`; kudos @Mec-iS, @Tpt
88
* begin refactoring `KnowledgeGraph` as abstract classes, per #237
9+
* update to Morph-KGC 2.0.0 and update links to the new documentation; kudos @ArenasGuerreroJulian
910

1011

1112
## 0.6.0

kglab/graph.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def __init__ (
5555
self.__prefix: dict = {}
5656

5757
self._tuples: list = []
58-
self._node_names: np.array = np.empty(shape=[0, 1], dtype=object)
59-
self._rel_names: np.array = np.empty(shape=[0, 1], dtype=object)
58+
self._node_names: np.array = np.empty(shape=[0, 1], dtype=object) # type: ignore
59+
self._rel_names: np.array = np.empty(shape=[0, 1], dtype=object) # type: ignore
6060

6161

6262
######################################################################
@@ -101,7 +101,7 @@ def get_node_name (
101101
An accessor method to map from the `node_id` index of a node to its
102102
unique name.
103103
"""
104-
return self._node_names[node_id]
104+
return self._node_names[node_id] # type: ignore
105105

106106

107107
def get_rel_id (
@@ -131,7 +131,7 @@ def get_rel_name (
131131
An accessor method to map from the `rel_id` index of a relation to its
132132
unique name.
133133
"""
134-
return self._rel_names[rel_id]
134+
return self._rel_names[rel_id] # type: ignore
135135

136136

137137
def build_tuple (

kglab/kglab.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def load_parquet (
835835

836836
df.apply(
837837
lambda row: self._g.parse(
838-
data="{} {} {} .".format(row[0], row[1], row[2]),
838+
data=f"{ row[0] } { row[1] } { row[2] } .",
839839
format="ttl",
840840
),
841841
axis=1,
@@ -1211,11 +1211,12 @@ def unbind_sparql (
12111211
sparql_meta, sparql_body = re.split(r"\s*WHERE\s*\{", sparql, maxsplit=1)
12121212

12131213
for var in sorted(bindings.keys(), key=lambda x: len(x), reverse=True): # pylint: disable=W0108
1214-
pattern = re.compile("(\?" + var + ")(\W)") # pylint: disable=W1401
1214+
pattern = re.compile(r"(\?" + var + r")(\W)") # pylint: disable=W1401
12151215
bind_val = "<" + str(bindings[var]) + ">\\2"
12161216
sparql_body = re.sub(pattern, bind_val, sparql_body)
12171217

1218-
return "".join([preamble, sparql_meta, " WHERE {", sparql_body]).strip()
1218+
result = "".join([preamble, sparql_meta, " WHERE {", sparql_body]).strip()
1219+
return result
12191220

12201221

12211222
######################################################################

0 commit comments

Comments
 (0)