Skip to content

Commit

Permalink
Optimize search() with multiple criteria, including those done by PyM…
Browse files Browse the repository at this point in the history
…edTermino
Jean-Baptiste "Jiba" Lamy authored and Jean-Baptiste "Jiba" Lamy committed Jul 22, 2019
1 parent 7581afb commit 77b2eba
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -405,6 +405,7 @@ version 2 - 0.19
* Add bottomObjectProperty and bottomDataProperty
* Support ReflexiveProperties in individual.INDIRECT_property
* Optimize Thing.subclasses()
* Optimize search() with multiple criteria, including those done by PyMedTermino
* Add support for destroy_entity(SWRL_rule)
* Bugfixes:
- After reasoning, keep all equivalent classes as parents of individuals (as they may have methods)
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

VERSION = "0.18"
VERSION = "0.19"

JAVA_EXE = "java"

3 changes: 2 additions & 1 deletion rdfxml_2_ntriples.py
Original file line number Diff line number Diff line change
@@ -160,11 +160,12 @@ def startElement(tag, attrs):
stack.append(["RDF", ""])

namespace_base = attrs.get("http://www.w3.org/XML/1998/namespacebase")

if namespace_base:
xml_base = namespace_base
if "/" in namespace_base:
xml_dir = namespace_base.rsplit("/", 1)[0] + "/"

else:
iri = attrs.get("http://www.w3.org/1999/02/22-rdf-syntax-ns#resource")
if iri:
17 changes: 11 additions & 6 deletions triplelite.py
Original file line number Diff line number Diff line change
@@ -1104,7 +1104,7 @@ def on_prepare_data(s, p, o, d):
def on_finish():
if filename: date = os.path.getmtime(filename)
else: date = time.time()

insert_objs()
insert_datas()

@@ -1493,11 +1493,16 @@ def __init__(self, world, prop_vals, c = None, case_sensitive = True):

n += 1
i = "%s_%s" % (self.id, n)
if n == 1: self.target = i
if d is None: self.tables.append("objs q%s" % i)
elif d == "quads": self.tables.append("quads q%s" % i)
else: self.tables.append("datas q%s" % i)

if n == 1:
self.target = i
if d is None: self.tables.append("objs q%s" % i)
elif d == "quads": self.tables.append("quads q%s" % i)
else: self.tables.append("datas q%s" % i)
else:
if d is None: self.tables.append("objs q%s INDEXED BY index_objs_sp" % i)
elif d == "quads": self.tables.append("quads q%s" % i)
else: self.tables.append("datas q%s INDEXED BY index_datas_sp" % i)

if not c is None:
self.conditions .append("q%s.c = ?" % i)
self.params .append(c)

0 comments on commit 77b2eba

Please sign in to comment.