diff --git a/builder/core/src/main/java/com/antgroup/openspg/builder/core/physical/operator/protocol/PythonRecord.java b/builder/core/src/main/java/com/antgroup/openspg/builder/core/physical/operator/protocol/PythonRecord.java index 3422598d..4f366e49 100644 --- a/builder/core/src/main/java/com/antgroup/openspg/builder/core/physical/operator/protocol/PythonRecord.java +++ b/builder/core/src/main/java/com/antgroup/openspg/builder/core/physical/operator/protocol/PythonRecord.java @@ -13,6 +13,7 @@ package com.antgroup.openspg.builder.core.physical.operator.protocol; +import java.util.HashMap; import java.util.Map; import lombok.Getter; import lombok.Setter; @@ -30,4 +31,11 @@ public class PythonRecord { public String getId() { return properties.get("id"); } + + public Map toMap() { + Map results = new HashMap<>(2); + results.put("spgTypeName", spgTypeName); + results.put("properties", properties); + return results; + } } diff --git a/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/fusing/impl/OperatorFusing.java b/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/fusing/impl/OperatorFusing.java index b63c0f03..d940d9ee 100644 --- a/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/fusing/impl/OperatorFusing.java +++ b/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/fusing/impl/OperatorFusing.java @@ -51,8 +51,8 @@ public class OperatorFusing implements EntityFusing { @Override public List entityFusing(List records) throws FusingException { - List pythonRecords = - CollectionsUtils.listMap(records, PythonRecordConvertor::toPythonRecord); + List> pythonRecords = + CollectionsUtils.listMap(records, r -> PythonRecordConvertor.toPythonRecord(r).toMap()); InvokeResultWrapper> invokeResultWrapper = null; try { Map result = diff --git a/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/predicting/impl/OperatorPredicting.java b/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/predicting/impl/OperatorPredicting.java index b0d086f2..e53a497b 100644 --- a/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/predicting/impl/OperatorPredicting.java +++ b/builder/core/src/main/java/com/antgroup/openspg/builder/core/strategy/predicting/impl/OperatorPredicting.java @@ -52,7 +52,7 @@ public class OperatorPredicting implements PropertyPredicting { @Override public List propertyPredicting(BaseAdvancedRecord record) throws PredictingException { - PythonRecord pythonRecord = PythonRecordConvertor.toPythonRecord(record); + Map pythonRecord = PythonRecordConvertor.toPythonRecord(record).toMap(); InvokeResultWrapper> invokeResultWrapper = null; try { Map result = diff --git a/builder/model/src/main/java/com/antgroup/openspg/builder/model/record/BaseSPGRecord.java b/builder/model/src/main/java/com/antgroup/openspg/builder/model/record/BaseSPGRecord.java index 40a9d394..79d672bd 100644 --- a/builder/model/src/main/java/com/antgroup/openspg/builder/model/record/BaseSPGRecord.java +++ b/builder/model/src/main/java/com/antgroup/openspg/builder/model/record/BaseSPGRecord.java @@ -40,14 +40,6 @@ public abstract class BaseSPGRecord extends BaseRecord implements WithSPGTypeEnu return rawPropertyValueMap; } - public Map getStdPropertyValueMap() { - Map stdPropertyValueMap = new HashMap<>(getProperties().size()); - for (BasePropertyRecord propertyRecord : getProperties()) { - stdPropertyValueMap.put(propertyRecord.getName(), propertyRecord.getValue().getStds()); - } - return stdPropertyValueMap; - } - public Map getStdStrPropertyValueMap() { Map stdStrPropertyValueMap = new HashMap<>(getProperties().size()); for (BasePropertyRecord propertyRecord : getProperties()) { diff --git a/cloudext/interface/search-engine/src/main/java/com/antgroup/openspg/cloudext/interfaces/searchengine/adapter/record/impl/SPGRecord2IdxServiceImpl.java b/cloudext/interface/search-engine/src/main/java/com/antgroup/openspg/cloudext/interfaces/searchengine/adapter/record/impl/SPGRecord2IdxServiceImpl.java index f1ff54f8..999aae39 100644 --- a/cloudext/interface/search-engine/src/main/java/com/antgroup/openspg/cloudext/interfaces/searchengine/adapter/record/impl/SPGRecord2IdxServiceImpl.java +++ b/cloudext/interface/search-engine/src/main/java/com/antgroup/openspg/cloudext/interfaces/searchengine/adapter/record/impl/SPGRecord2IdxServiceImpl.java @@ -22,7 +22,9 @@ import com.antgroup.openspg.cloudext.interfaces.searchengine.model.idx.record.Id import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; +import java.util.Map; +@SuppressWarnings({"rawtypes", "unchecked"}) public class SPGRecord2IdxServiceImpl implements SPGRecord2IdxService { @Override @@ -36,6 +38,9 @@ public class SPGRecord2IdxServiceImpl implements SPGRecord2IdxService { new IdxRecordAlterItem( item.getAlterOp(), new IdxRecord( - spgRecord.getName(), spgRecord.getId(), 0.0, spgRecord.getStdPropertyValueMap()))); + spgRecord.getName(), + spgRecord.getId(), + 0.0, + (Map) spgRecord.getStdStrPropertyValueMap()))); } } diff --git a/python/KNEXT_VERSION b/python/KNEXT_VERSION deleted file mode 100644 index cc053f9e..00000000 --- a/python/KNEXT_VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1-beta2 \ No newline at end of file diff --git a/python/MANIFEST.in b/python/MANIFEST.in deleted file mode 100644 index 0785ebfd..00000000 --- a/python/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include knext * -recursive-exclude knext/examples * \ No newline at end of file diff --git a/python/knext/.gitignore b/python/knext/.gitignore new file mode 100644 index 00000000..4baf9d4c --- /dev/null +++ b/python/knext/.gitignore @@ -0,0 +1,3 @@ +/*.whl +/*.egg-info/ +/build/ diff --git a/python/knext/KNEXT_VERSION b/python/knext/KNEXT_VERSION new file mode 100644 index 00000000..6adbd73c --- /dev/null +++ b/python/knext/KNEXT_VERSION @@ -0,0 +1 @@ +0.0.1-beta2 diff --git a/python/LICENSE b/python/knext/LICENSE similarity index 97% rename from python/LICENSE rename to python/knext/LICENSE index b6c45638..ff40fe57 100644 --- a/python/LICENSE +++ b/python/knext/LICENSE @@ -7,4 +7,4 @@ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -or implied. \ No newline at end of file +or implied. diff --git a/python/knext/MANIFEST.in b/python/knext/MANIFEST.in new file mode 100644 index 00000000..1eee8aec --- /dev/null +++ b/python/knext/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include knext * +recursive-exclude knext/examples * diff --git a/python/knext/__init__.py b/python/knext/knext/__init__.py similarity index 100% rename from python/knext/__init__.py rename to python/knext/knext/__init__.py diff --git a/python/knext/api/__init__.py b/python/knext/knext/api/__init__.py similarity index 100% rename from python/knext/api/__init__.py rename to python/knext/knext/api/__init__.py diff --git a/python/knext/api/chain.py b/python/knext/knext/api/chain.py similarity index 100% rename from python/knext/api/chain.py rename to python/knext/knext/api/chain.py diff --git a/python/knext/api/client.py b/python/knext/knext/api/client.py similarity index 100% rename from python/knext/api/client.py rename to python/knext/knext/api/client.py diff --git a/python/knext/api/component.py b/python/knext/knext/api/component.py similarity index 100% rename from python/knext/api/component.py rename to python/knext/knext/api/component.py diff --git a/python/knext/api/operator.py b/python/knext/knext/api/operator.py similarity index 100% rename from python/knext/api/operator.py rename to python/knext/knext/api/operator.py diff --git a/python/knext/chain/__init__.py b/python/knext/knext/chain/__init__.py similarity index 100% rename from python/knext/chain/__init__.py rename to python/knext/knext/chain/__init__.py diff --git a/python/knext/chain/base.py b/python/knext/knext/chain/base.py similarity index 100% rename from python/knext/chain/base.py rename to python/knext/knext/chain/base.py diff --git a/python/knext/chain/builder_chain.py b/python/knext/knext/chain/builder_chain.py similarity index 100% rename from python/knext/chain/builder_chain.py rename to python/knext/knext/chain/builder_chain.py diff --git a/python/knext/client/__init__.py b/python/knext/knext/client/__init__.py similarity index 100% rename from python/knext/client/__init__.py rename to python/knext/knext/client/__init__.py diff --git a/python/knext/client/base.py b/python/knext/knext/client/base.py similarity index 100% rename from python/knext/client/base.py rename to python/knext/knext/client/base.py diff --git a/python/knext/client/builder.py b/python/knext/knext/client/builder.py similarity index 100% rename from python/knext/client/builder.py rename to python/knext/knext/client/builder.py diff --git a/python/knext/client/marklang/__init__.py b/python/knext/knext/client/marklang/__init__.py similarity index 100% rename from python/knext/client/marklang/__init__.py rename to python/knext/knext/client/marklang/__init__.py diff --git a/python/knext/client/marklang/concept_rule_ml.py b/python/knext/knext/client/marklang/concept_rule_ml.py similarity index 100% rename from python/knext/client/marklang/concept_rule_ml.py rename to python/knext/knext/client/marklang/concept_rule_ml.py diff --git a/python/knext/client/marklang/schema_ml.py b/python/knext/knext/client/marklang/schema_ml.py similarity index 100% rename from python/knext/client/marklang/schema_ml.py rename to python/knext/knext/client/marklang/schema_ml.py diff --git a/python/knext/client/model/__init__.py b/python/knext/knext/client/model/__init__.py similarity index 100% rename from python/knext/client/model/__init__.py rename to python/knext/knext/client/model/__init__.py diff --git a/python/knext/client/model/base.py b/python/knext/knext/client/model/base.py similarity index 100% rename from python/knext/client/model/base.py rename to python/knext/knext/client/model/base.py diff --git a/python/knext/client/model/builder_job.py b/python/knext/knext/client/model/builder_job.py similarity index 100% rename from python/knext/client/model/builder_job.py rename to python/knext/knext/client/model/builder_job.py diff --git a/python/knext/client/model/property.py b/python/knext/knext/client/model/property.py similarity index 100% rename from python/knext/client/model/property.py rename to python/knext/knext/client/model/property.py diff --git a/python/knext/client/model/relation.py b/python/knext/knext/client/model/relation.py similarity index 100% rename from python/knext/client/model/relation.py rename to python/knext/knext/client/model/relation.py diff --git a/python/knext/client/model/spg_type.py b/python/knext/knext/client/model/spg_type.py similarity index 100% rename from python/knext/client/model/spg_type.py rename to python/knext/knext/client/model/spg_type.py diff --git a/python/knext/client/operator.py b/python/knext/knext/client/operator.py similarity index 100% rename from python/knext/client/operator.py rename to python/knext/knext/client/operator.py diff --git a/python/knext/client/reasoner.py b/python/knext/knext/client/reasoner.py similarity index 100% rename from python/knext/client/reasoner.py rename to python/knext/knext/client/reasoner.py diff --git a/python/knext/client/schema.py b/python/knext/knext/client/schema.py similarity index 100% rename from python/knext/client/schema.py rename to python/knext/knext/client/schema.py diff --git a/python/knext/client/search.py b/python/knext/knext/client/search.py similarity index 100% rename from python/knext/client/search.py rename to python/knext/knext/client/search.py diff --git a/python/knext/command/__init__.py b/python/knext/knext/command/__init__.py similarity index 100% rename from python/knext/command/__init__.py rename to python/knext/knext/command/__init__.py diff --git a/python/knext/command/exception.py b/python/knext/knext/command/exception.py similarity index 100% rename from python/knext/command/exception.py rename to python/knext/knext/command/exception.py diff --git a/python/knext/command/knext_cli.py b/python/knext/knext/command/knext_cli.py similarity index 100% rename from python/knext/command/knext_cli.py rename to python/knext/knext/command/knext_cli.py diff --git a/python/knext/command/sub_command/__init__.py b/python/knext/knext/command/sub_command/__init__.py similarity index 100% rename from python/knext/command/sub_command/__init__.py rename to python/knext/knext/command/sub_command/__init__.py diff --git a/python/knext/command/sub_command/builder.py b/python/knext/knext/command/sub_command/builder.py similarity index 100% rename from python/knext/command/sub_command/builder.py rename to python/knext/knext/command/sub_command/builder.py diff --git a/python/knext/command/sub_command/config.py b/python/knext/knext/command/sub_command/config.py similarity index 100% rename from python/knext/command/sub_command/config.py rename to python/knext/knext/command/sub_command/config.py diff --git a/python/knext/command/sub_command/operator.py b/python/knext/knext/command/sub_command/operator.py similarity index 100% rename from python/knext/command/sub_command/operator.py rename to python/knext/knext/command/sub_command/operator.py diff --git a/python/knext/command/sub_command/project.py b/python/knext/knext/command/sub_command/project.py similarity index 100% rename from python/knext/command/sub_command/project.py rename to python/knext/knext/command/sub_command/project.py diff --git a/python/knext/command/sub_command/reasoner.py b/python/knext/knext/command/sub_command/reasoner.py similarity index 100% rename from python/knext/command/sub_command/reasoner.py rename to python/knext/knext/command/sub_command/reasoner.py diff --git a/python/knext/command/sub_command/schema.py b/python/knext/knext/command/sub_command/schema.py similarity index 100% rename from python/knext/command/sub_command/schema.py rename to python/knext/knext/command/sub_command/schema.py diff --git a/python/knext/common/__init__.py b/python/knext/knext/common/__init__.py similarity index 100% rename from python/knext/common/__init__.py rename to python/knext/knext/common/__init__.py diff --git a/python/knext/common/class_loader.py b/python/knext/knext/common/class_loader.py similarity index 100% rename from python/knext/common/class_loader.py rename to python/knext/knext/common/class_loader.py diff --git a/python/knext/common/class_register.py b/python/knext/knext/common/class_register.py similarity index 100% rename from python/knext/common/class_register.py rename to python/knext/knext/common/class_register.py diff --git a/python/knext/common/env.py b/python/knext/knext/common/env.py similarity index 100% rename from python/knext/common/env.py rename to python/knext/knext/common/env.py diff --git a/python/knext/common/restable.py b/python/knext/knext/common/restable.py similarity index 100% rename from python/knext/common/restable.py rename to python/knext/knext/common/restable.py diff --git a/python/knext/common/runnable.py b/python/knext/knext/common/runnable.py similarity index 100% rename from python/knext/common/runnable.py rename to python/knext/knext/common/runnable.py diff --git a/python/knext/common/schema_helper.py b/python/knext/knext/common/schema_helper.py similarity index 100% rename from python/knext/common/schema_helper.py rename to python/knext/knext/common/schema_helper.py diff --git a/python/knext/common/template.py b/python/knext/knext/common/template.py similarity index 100% rename from python/knext/common/template.py rename to python/knext/knext/common/template.py diff --git a/python/knext/component/__init__.py b/python/knext/knext/component/__init__.py similarity index 100% rename from python/knext/component/__init__.py rename to python/knext/knext/component/__init__.py diff --git a/python/knext/component/base.py b/python/knext/knext/component/base.py similarity index 100% rename from python/knext/component/base.py rename to python/knext/knext/component/base.py diff --git a/python/knext/component/builder/__init__.py b/python/knext/knext/component/builder/__init__.py similarity index 100% rename from python/knext/component/builder/__init__.py rename to python/knext/knext/component/builder/__init__.py diff --git a/python/knext/component/builder/base.py b/python/knext/knext/component/builder/base.py similarity index 100% rename from python/knext/component/builder/base.py rename to python/knext/knext/component/builder/base.py diff --git a/python/knext/component/builder/extractor.py b/python/knext/knext/component/builder/extractor.py similarity index 100% rename from python/knext/component/builder/extractor.py rename to python/knext/knext/component/builder/extractor.py diff --git a/python/knext/component/builder/mapping.py b/python/knext/knext/component/builder/mapping.py similarity index 100% rename from python/knext/component/builder/mapping.py rename to python/knext/knext/component/builder/mapping.py diff --git a/python/knext/component/builder/sink_writer.py b/python/knext/knext/component/builder/sink_writer.py similarity index 100% rename from python/knext/component/builder/sink_writer.py rename to python/knext/knext/component/builder/sink_writer.py diff --git a/python/knext/component/builder/source_reader.py b/python/knext/knext/component/builder/source_reader.py similarity index 100% rename from python/knext/component/builder/source_reader.py rename to python/knext/knext/component/builder/source_reader.py diff --git a/python/knext/component/reasoner/__init__.py b/python/knext/knext/component/reasoner/__init__.py similarity index 100% rename from python/knext/component/reasoner/__init__.py rename to python/knext/knext/component/reasoner/__init__.py diff --git a/python/knext/examples/financial/.knext.cfg b/python/knext/knext/examples/financial/.knext.cfg similarity index 100% rename from python/knext/examples/financial/.knext.cfg rename to python/knext/knext/examples/financial/.knext.cfg diff --git a/python/knext/examples/financial/README.md b/python/knext/knext/examples/financial/README.md similarity index 100% rename from python/knext/examples/financial/README.md rename to python/knext/knext/examples/financial/README.md diff --git a/python/knext/examples/financial/builder/job/data/document.csv b/python/knext/knext/examples/financial/builder/job/data/document.csv similarity index 100% rename from python/knext/examples/financial/builder/job/data/document.csv rename to python/knext/knext/examples/financial/builder/job/data/document.csv diff --git a/python/knext/examples/financial/builder/job/state_and_indicator.py b/python/knext/knext/examples/financial/builder/job/state_and_indicator.py similarity index 100% rename from python/knext/examples/financial/builder/job/state_and_indicator.py rename to python/knext/knext/examples/financial/builder/job/state_and_indicator.py diff --git a/python/knext/examples/financial/builder/model/openai_infer.json b/python/knext/knext/examples/financial/builder/model/openai_infer.json similarity index 100% rename from python/knext/examples/financial/builder/model/openai_infer.json rename to python/knext/knext/examples/financial/builder/model/openai_infer.json diff --git a/python/knext/examples/financial/builder/operator/IndicatorFuse.py b/python/knext/knext/examples/financial/builder/operator/IndicatorFuse.py similarity index 100% rename from python/knext/examples/financial/builder/operator/IndicatorFuse.py rename to python/knext/knext/examples/financial/builder/operator/IndicatorFuse.py diff --git a/python/knext/examples/financial/builder/operator/IndicatorLOGIC.py b/python/knext/knext/examples/financial/builder/operator/IndicatorLOGIC.py similarity index 100% rename from python/knext/examples/financial/builder/operator/IndicatorLOGIC.py rename to python/knext/knext/examples/financial/builder/operator/IndicatorLOGIC.py diff --git a/python/knext/examples/financial/builder/operator/IndicatorNER.py b/python/knext/knext/examples/financial/builder/operator/IndicatorNER.py similarity index 100% rename from python/knext/examples/financial/builder/operator/IndicatorNER.py rename to python/knext/knext/examples/financial/builder/operator/IndicatorNER.py diff --git a/python/knext/examples/financial/builder/operator/IndicatorPredict.py b/python/knext/knext/examples/financial/builder/operator/IndicatorPredict.py similarity index 100% rename from python/knext/examples/financial/builder/operator/IndicatorPredict.py rename to python/knext/knext/examples/financial/builder/operator/IndicatorPredict.py diff --git a/python/knext/examples/financial/builder/operator/IndicatorREL.py b/python/knext/knext/examples/financial/builder/operator/IndicatorREL.py similarity index 100% rename from python/knext/examples/financial/builder/operator/IndicatorREL.py rename to python/knext/knext/examples/financial/builder/operator/IndicatorREL.py diff --git a/python/knext/examples/financial/builder/operator/StateFuse.py b/python/knext/knext/examples/financial/builder/operator/StateFuse.py similarity index 100% rename from python/knext/examples/financial/builder/operator/StateFuse.py rename to python/knext/knext/examples/financial/builder/operator/StateFuse.py diff --git a/python/knext/examples/financial/schema/financial.schema b/python/knext/knext/examples/financial/schema/financial.schema similarity index 100% rename from python/knext/examples/financial/schema/financial.schema rename to python/knext/knext/examples/financial/schema/financial.schema diff --git a/python/knext/examples/financial/schema/financial_schema_helper.py b/python/knext/knext/examples/financial/schema/financial_schema_helper.py similarity index 100% rename from python/knext/examples/financial/schema/financial_schema_helper.py rename to python/knext/knext/examples/financial/schema/financial_schema_helper.py diff --git a/python/knext/examples/medical/.knext.cfg b/python/knext/knext/examples/medical/.knext.cfg similarity index 100% rename from python/knext/examples/medical/.knext.cfg rename to python/knext/knext/examples/medical/.knext.cfg diff --git a/python/knext/examples/medical/builder/job/body_part.py b/python/knext/knext/examples/medical/builder/job/body_part.py similarity index 100% rename from python/knext/examples/medical/builder/job/body_part.py rename to python/knext/knext/examples/medical/builder/job/body_part.py diff --git a/python/knext/examples/medical/builder/job/data/BodyPart.csv b/python/knext/knext/examples/medical/builder/job/data/BodyPart.csv similarity index 100% rename from python/knext/examples/medical/builder/job/data/BodyPart.csv rename to python/knext/knext/examples/medical/builder/job/data/BodyPart.csv diff --git a/python/knext/examples/medical/builder/job/data/Disease.csv b/python/knext/knext/examples/medical/builder/job/data/Disease.csv similarity index 100% rename from python/knext/examples/medical/builder/job/data/Disease.csv rename to python/knext/knext/examples/medical/builder/job/data/Disease.csv diff --git a/python/knext/examples/medical/builder/job/data/HospitalDepartment.csv b/python/knext/knext/examples/medical/builder/job/data/HospitalDepartment.csv similarity index 100% rename from python/knext/examples/medical/builder/job/data/HospitalDepartment.csv rename to python/knext/knext/examples/medical/builder/job/data/HospitalDepartment.csv diff --git a/python/knext/examples/medical/builder/job/disease.py b/python/knext/knext/examples/medical/builder/job/disease.py similarity index 100% rename from python/knext/examples/medical/builder/job/disease.py rename to python/knext/knext/examples/medical/builder/job/disease.py diff --git a/python/knext/examples/medical/builder/job/hospital_department.py b/python/knext/knext/examples/medical/builder/job/hospital_department.py similarity index 100% rename from python/knext/examples/medical/builder/job/hospital_department.py rename to python/knext/knext/examples/medical/builder/job/hospital_department.py diff --git a/python/knext/examples/medical/builder/model/openai_infer.json b/python/knext/knext/examples/medical/builder/model/openai_infer.json similarity index 100% rename from python/knext/examples/medical/builder/model/openai_infer.json rename to python/knext/knext/examples/medical/builder/model/openai_infer.json diff --git a/python/knext/examples/medical/builder/operator/disease_extractor.py b/python/knext/knext/examples/medical/builder/operator/disease_extractor.py similarity index 100% rename from python/knext/examples/medical/builder/operator/disease_extractor.py rename to python/knext/knext/examples/medical/builder/operator/disease_extractor.py diff --git a/python/knext/examples/medical/schema/medical.schema b/python/knext/knext/examples/medical/schema/medical.schema similarity index 100% rename from python/knext/examples/medical/schema/medical.schema rename to python/knext/knext/examples/medical/schema/medical.schema diff --git a/python/knext/examples/medical/schema/medical_schema_helper.py b/python/knext/knext/examples/medical/schema/medical_schema_helper.py similarity index 100% rename from python/knext/examples/medical/schema/medical_schema_helper.py rename to python/knext/knext/examples/medical/schema/medical_schema_helper.py diff --git a/python/knext/examples/riskmining/.knext.cfg b/python/knext/knext/examples/riskmining/.knext.cfg similarity index 100% rename from python/knext/examples/riskmining/.knext.cfg rename to python/knext/knext/examples/riskmining/.knext.cfg diff --git a/python/knext/examples/riskmining/README.md b/python/knext/knext/examples/riskmining/README.md similarity index 100% rename from python/knext/examples/riskmining/README.md rename to python/knext/knext/examples/riskmining/README.md diff --git a/python/knext/examples/riskmining/builder/job/app.py b/python/knext/knext/examples/riskmining/builder/job/app.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/app.py rename to python/knext/knext/examples/riskmining/builder/job/app.py diff --git a/python/knext/examples/riskmining/builder/job/cert.py b/python/knext/knext/examples/riskmining/builder/job/cert.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/cert.py rename to python/knext/knext/examples/riskmining/builder/job/cert.py diff --git a/python/knext/examples/riskmining/builder/job/company.py b/python/knext/knext/examples/riskmining/builder/job/company.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/company.py rename to python/knext/knext/examples/riskmining/builder/job/company.py diff --git a/python/knext/examples/riskmining/builder/job/data/App.csv b/python/knext/knext/examples/riskmining/builder/job/data/App.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/App.csv rename to python/knext/knext/examples/riskmining/builder/job/data/App.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Cert.csv b/python/knext/knext/examples/riskmining/builder/job/data/Cert.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Cert.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Cert.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Company.csv b/python/knext/knext/examples/riskmining/builder/job/data/Company.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Company.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Company.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Company_hasCert_Cert.csv b/python/knext/knext/examples/riskmining/builder/job/data/Company_hasCert_Cert.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Company_hasCert_Cert.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Company_hasCert_Cert.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Device.csv b/python/knext/knext/examples/riskmining/builder/job/data/Device.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Device.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Device.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Person.csv b/python/knext/knext/examples/riskmining/builder/job/data/Person.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Person.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Person.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Person_fundTrans_Person.csv b/python/knext/knext/examples/riskmining/builder/job/data/Person_fundTrans_Person.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Person_fundTrans_Person.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Person_fundTrans_Person.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Person_hasCert_Cert.csv b/python/knext/knext/examples/riskmining/builder/job/data/Person_hasCert_Cert.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Person_hasCert_Cert.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Person_hasCert_Cert.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Person_hasDevice_Device.csv b/python/knext/knext/examples/riskmining/builder/job/data/Person_hasDevice_Device.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Person_hasDevice_Device.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Person_hasDevice_Device.csv diff --git a/python/knext/examples/riskmining/builder/job/data/Person_holdShare_Company.csv b/python/knext/knext/examples/riskmining/builder/job/data/Person_holdShare_Company.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/Person_holdShare_Company.csv rename to python/knext/knext/examples/riskmining/builder/job/data/Person_holdShare_Company.csv diff --git a/python/knext/examples/riskmining/builder/job/data/TaxOfRiskApp.csv b/python/knext/knext/examples/riskmining/builder/job/data/TaxOfRiskApp.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/TaxOfRiskApp.csv rename to python/knext/knext/examples/riskmining/builder/job/data/TaxOfRiskApp.csv diff --git a/python/knext/examples/riskmining/builder/job/data/TaxOfRiskUser.csv b/python/knext/knext/examples/riskmining/builder/job/data/TaxOfRiskUser.csv similarity index 100% rename from python/knext/examples/riskmining/builder/job/data/TaxOfRiskUser.csv rename to python/knext/knext/examples/riskmining/builder/job/data/TaxOfRiskUser.csv diff --git a/python/knext/examples/riskmining/builder/job/device.py b/python/knext/knext/examples/riskmining/builder/job/device.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/device.py rename to python/knext/knext/examples/riskmining/builder/job/device.py diff --git a/python/knext/examples/riskmining/builder/job/person.py b/python/knext/knext/examples/riskmining/builder/job/person.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/person.py rename to python/knext/knext/examples/riskmining/builder/job/person.py diff --git a/python/knext/examples/riskmining/builder/job/tax_of_risk_app.py b/python/knext/knext/examples/riskmining/builder/job/tax_of_risk_app.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/tax_of_risk_app.py rename to python/knext/knext/examples/riskmining/builder/job/tax_of_risk_app.py diff --git a/python/knext/examples/riskmining/builder/job/tax_of_risk_user.py b/python/knext/knext/examples/riskmining/builder/job/tax_of_risk_user.py similarity index 100% rename from python/knext/examples/riskmining/builder/job/tax_of_risk_user.py rename to python/knext/knext/examples/riskmining/builder/job/tax_of_risk_user.py diff --git a/python/knext/examples/riskmining/builder/operator/cert_link_operator.py b/python/knext/knext/examples/riskmining/builder/operator/cert_link_operator.py similarity index 100% rename from python/knext/examples/riskmining/builder/operator/cert_link_operator.py rename to python/knext/knext/examples/riskmining/builder/operator/cert_link_operator.py diff --git a/python/knext/examples/riskmining/reasoner/gambling_app.dsl b/python/knext/knext/examples/riskmining/reasoner/gambling_app.dsl similarity index 100% rename from python/knext/examples/riskmining/reasoner/gambling_app.dsl rename to python/knext/knext/examples/riskmining/reasoner/gambling_app.dsl diff --git a/python/knext/examples/riskmining/schema/concept.rule b/python/knext/knext/examples/riskmining/schema/concept.rule similarity index 100% rename from python/knext/examples/riskmining/schema/concept.rule rename to python/knext/knext/examples/riskmining/schema/concept.rule diff --git a/python/knext/examples/riskmining/schema/riskmining.schema b/python/knext/knext/examples/riskmining/schema/riskmining.schema similarity index 100% rename from python/knext/examples/riskmining/schema/riskmining.schema rename to python/knext/knext/examples/riskmining/schema/riskmining.schema diff --git a/python/knext/examples/riskmining/schema/riskmining_schema_helper.py b/python/knext/knext/examples/riskmining/schema/riskmining_schema_helper.py similarity index 100% rename from python/knext/examples/riskmining/schema/riskmining_schema_helper.py rename to python/knext/knext/examples/riskmining/schema/riskmining_schema_helper.py diff --git a/python/knext/examples/supplychain/.knext.cfg b/python/knext/knext/examples/supplychain/.knext.cfg similarity index 100% rename from python/knext/examples/supplychain/.knext.cfg rename to python/knext/knext/examples/supplychain/.knext.cfg diff --git a/python/knext/examples/supplychain/builder/job/company.py b/python/knext/knext/examples/supplychain/builder/job/company.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/company.py rename to python/knext/knext/examples/supplychain/builder/job/company.py diff --git a/python/knext/examples/supplychain/builder/job/data/Company.csv b/python/knext/knext/examples/supplychain/builder/job/data/Company.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Company.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Company.csv diff --git a/python/knext/examples/supplychain/builder/job/data/CompanyUpdate.csv b/python/knext/knext/examples/supplychain/builder/job/data/CompanyUpdate.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/CompanyUpdate.csv rename to python/knext/knext/examples/supplychain/builder/job/data/CompanyUpdate.csv diff --git a/python/knext/examples/supplychain/builder/job/data/Company_fundTrans_Company.csv b/python/knext/knext/examples/supplychain/builder/job/data/Company_fundTrans_Company.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Company_fundTrans_Company.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Company_fundTrans_Company.csv diff --git a/python/knext/examples/supplychain/builder/job/data/Index.csv b/python/knext/knext/examples/supplychain/builder/job/data/Index.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Index.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Index.csv diff --git a/python/knext/examples/supplychain/builder/job/data/Industry.csv b/python/knext/knext/examples/supplychain/builder/job/data/Industry.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Industry.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Industry.csv diff --git a/python/knext/examples/supplychain/builder/job/data/Person.csv b/python/knext/knext/examples/supplychain/builder/job/data/Person.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Person.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Person.csv diff --git a/python/knext/examples/supplychain/builder/job/data/Product.csv b/python/knext/knext/examples/supplychain/builder/job/data/Product.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Product.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Product.csv diff --git a/python/knext/examples/supplychain/builder/job/data/ProductChainEvent.csv b/python/knext/knext/examples/supplychain/builder/job/data/ProductChainEvent.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/ProductChainEvent.csv rename to python/knext/knext/examples/supplychain/builder/job/data/ProductChainEvent.csv diff --git a/python/knext/examples/supplychain/builder/job/data/TaxOfCompanyEvent.csv b/python/knext/knext/examples/supplychain/builder/job/data/TaxOfCompanyEvent.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/TaxOfCompanyEvent.csv rename to python/knext/knext/examples/supplychain/builder/job/data/TaxOfCompanyEvent.csv diff --git a/python/knext/examples/supplychain/builder/job/data/TaxOfProdEvent.csv b/python/knext/knext/examples/supplychain/builder/job/data/TaxOfProdEvent.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/TaxOfProdEvent.csv rename to python/knext/knext/examples/supplychain/builder/job/data/TaxOfProdEvent.csv diff --git a/python/knext/examples/supplychain/builder/job/data/Trend.csv b/python/knext/knext/examples/supplychain/builder/job/data/Trend.csv similarity index 100% rename from python/knext/examples/supplychain/builder/job/data/Trend.csv rename to python/knext/knext/examples/supplychain/builder/job/data/Trend.csv diff --git a/python/knext/examples/supplychain/builder/job/index.py b/python/knext/knext/examples/supplychain/builder/job/index.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/index.py rename to python/knext/knext/examples/supplychain/builder/job/index.py diff --git a/python/knext/examples/supplychain/builder/job/industry.py b/python/knext/knext/examples/supplychain/builder/job/industry.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/industry.py rename to python/knext/knext/examples/supplychain/builder/job/industry.py diff --git a/python/knext/examples/supplychain/builder/job/person.py b/python/knext/knext/examples/supplychain/builder/job/person.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/person.py rename to python/knext/knext/examples/supplychain/builder/job/person.py diff --git a/python/knext/examples/supplychain/builder/job/product.py b/python/knext/knext/examples/supplychain/builder/job/product.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/product.py rename to python/knext/knext/examples/supplychain/builder/job/product.py diff --git a/python/knext/examples/supplychain/builder/job/product_chain_event.py b/python/knext/knext/examples/supplychain/builder/job/product_chain_event.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/product_chain_event.py rename to python/knext/knext/examples/supplychain/builder/job/product_chain_event.py diff --git a/python/knext/examples/supplychain/builder/job/tax_of_company_event.py b/python/knext/knext/examples/supplychain/builder/job/tax_of_company_event.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/tax_of_company_event.py rename to python/knext/knext/examples/supplychain/builder/job/tax_of_company_event.py diff --git a/python/knext/examples/supplychain/builder/job/tax_of_product_event.py b/python/knext/knext/examples/supplychain/builder/job/tax_of_product_event.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/tax_of_product_event.py rename to python/knext/knext/examples/supplychain/builder/job/tax_of_product_event.py diff --git a/python/knext/examples/supplychain/builder/job/trend.py b/python/knext/knext/examples/supplychain/builder/job/trend.py similarity index 100% rename from python/knext/examples/supplychain/builder/job/trend.py rename to python/knext/knext/examples/supplychain/builder/job/trend.py diff --git a/python/knext/examples/supplychain/builder/operator/company_operator.py b/python/knext/knext/examples/supplychain/builder/operator/company_operator.py similarity index 100% rename from python/knext/examples/supplychain/builder/operator/company_operator.py rename to python/knext/knext/examples/supplychain/builder/operator/company_operator.py diff --git a/python/knext/examples/supplychain/reasoner/fund_trans_feature.dsl b/python/knext/knext/examples/supplychain/reasoner/fund_trans_feature.dsl similarity index 100% rename from python/knext/examples/supplychain/reasoner/fund_trans_feature.dsl rename to python/knext/knext/examples/supplychain/reasoner/fund_trans_feature.dsl diff --git a/python/knext/examples/supplychain/reasoner/same_legal_reprensentative.dsl b/python/knext/knext/examples/supplychain/reasoner/same_legal_reprensentative.dsl similarity index 100% rename from python/knext/examples/supplychain/reasoner/same_legal_reprensentative.dsl rename to python/knext/knext/examples/supplychain/reasoner/same_legal_reprensentative.dsl diff --git a/python/knext/examples/supplychain/schema/concept.rule b/python/knext/knext/examples/supplychain/schema/concept.rule similarity index 100% rename from python/knext/examples/supplychain/schema/concept.rule rename to python/knext/knext/examples/supplychain/schema/concept.rule diff --git a/python/knext/examples/supplychain/schema/supplychain.schema b/python/knext/knext/examples/supplychain/schema/supplychain.schema similarity index 100% rename from python/knext/examples/supplychain/schema/supplychain.schema rename to python/knext/knext/examples/supplychain/schema/supplychain.schema diff --git a/python/knext/examples/supplychain/schema/supplychain_schema_helper.py b/python/knext/knext/examples/supplychain/schema/supplychain_schema_helper.py similarity index 100% rename from python/knext/examples/supplychain/schema/supplychain_schema_helper.py rename to python/knext/knext/examples/supplychain/schema/supplychain_schema_helper.py diff --git a/python/knext/examples/supplychain1/.knext.cfg b/python/knext/knext/examples/supplychain1/.knext.cfg similarity index 100% rename from python/knext/examples/supplychain1/.knext.cfg rename to python/knext/knext/examples/supplychain1/.knext.cfg diff --git a/python/knext/examples/supplychain1/builder/job/company.py b/python/knext/knext/examples/supplychain1/builder/job/company.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/company.py rename to python/knext/knext/examples/supplychain1/builder/job/company.py diff --git a/python/knext/examples/supplychain1/builder/job/data/Company.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Company.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Company.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Company.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/CompanyUpdate.csv b/python/knext/knext/examples/supplychain1/builder/job/data/CompanyUpdate.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/CompanyUpdate.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/CompanyUpdate.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/Company_fundTrans_Company.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Company_fundTrans_Company.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Company_fundTrans_Company.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Company_fundTrans_Company.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/Index.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Index.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Index.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Index.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/Industry.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Industry.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Industry.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Industry.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/Person.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Person.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Person.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Person.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/Product.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Product.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Product.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Product.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/ProductChainEvent.csv b/python/knext/knext/examples/supplychain1/builder/job/data/ProductChainEvent.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/ProductChainEvent.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/ProductChainEvent.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/TaxOfCompanyEvent.csv b/python/knext/knext/examples/supplychain1/builder/job/data/TaxOfCompanyEvent.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/TaxOfCompanyEvent.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/TaxOfCompanyEvent.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/TaxOfProdEvent.csv b/python/knext/knext/examples/supplychain1/builder/job/data/TaxOfProdEvent.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/TaxOfProdEvent.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/TaxOfProdEvent.csv diff --git a/python/knext/examples/supplychain1/builder/job/data/Trend.csv b/python/knext/knext/examples/supplychain1/builder/job/data/Trend.csv similarity index 100% rename from python/knext/examples/supplychain1/builder/job/data/Trend.csv rename to python/knext/knext/examples/supplychain1/builder/job/data/Trend.csv diff --git a/python/knext/examples/supplychain1/builder/job/index.py b/python/knext/knext/examples/supplychain1/builder/job/index.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/index.py rename to python/knext/knext/examples/supplychain1/builder/job/index.py diff --git a/python/knext/examples/supplychain1/builder/job/industry.py b/python/knext/knext/examples/supplychain1/builder/job/industry.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/industry.py rename to python/knext/knext/examples/supplychain1/builder/job/industry.py diff --git a/python/knext/examples/supplychain1/builder/job/person.py b/python/knext/knext/examples/supplychain1/builder/job/person.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/person.py rename to python/knext/knext/examples/supplychain1/builder/job/person.py diff --git a/python/knext/examples/supplychain1/builder/job/product.py b/python/knext/knext/examples/supplychain1/builder/job/product.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/product.py rename to python/knext/knext/examples/supplychain1/builder/job/product.py diff --git a/python/knext/examples/supplychain1/builder/job/product_chain_event.py b/python/knext/knext/examples/supplychain1/builder/job/product_chain_event.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/product_chain_event.py rename to python/knext/knext/examples/supplychain1/builder/job/product_chain_event.py diff --git a/python/knext/examples/supplychain1/builder/job/tax_of_company_event.py b/python/knext/knext/examples/supplychain1/builder/job/tax_of_company_event.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/tax_of_company_event.py rename to python/knext/knext/examples/supplychain1/builder/job/tax_of_company_event.py diff --git a/python/knext/examples/supplychain1/builder/job/tax_of_product_event.py b/python/knext/knext/examples/supplychain1/builder/job/tax_of_product_event.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/tax_of_product_event.py rename to python/knext/knext/examples/supplychain1/builder/job/tax_of_product_event.py diff --git a/python/knext/examples/supplychain1/builder/job/trend.py b/python/knext/knext/examples/supplychain1/builder/job/trend.py similarity index 100% rename from python/knext/examples/supplychain1/builder/job/trend.py rename to python/knext/knext/examples/supplychain1/builder/job/trend.py diff --git a/python/knext/examples/supplychain1/builder/operator/company_operator.py b/python/knext/knext/examples/supplychain1/builder/operator/company_operator.py similarity index 100% rename from python/knext/examples/supplychain1/builder/operator/company_operator.py rename to python/knext/knext/examples/supplychain1/builder/operator/company_operator.py diff --git a/python/knext/examples/supplychain1/reasoner/fund_trans_feature.dsl b/python/knext/knext/examples/supplychain1/reasoner/fund_trans_feature.dsl similarity index 100% rename from python/knext/examples/supplychain1/reasoner/fund_trans_feature.dsl rename to python/knext/knext/examples/supplychain1/reasoner/fund_trans_feature.dsl diff --git a/python/knext/examples/supplychain1/reasoner/same_legal_reprensentative.dsl b/python/knext/knext/examples/supplychain1/reasoner/same_legal_reprensentative.dsl similarity index 100% rename from python/knext/examples/supplychain1/reasoner/same_legal_reprensentative.dsl rename to python/knext/knext/examples/supplychain1/reasoner/same_legal_reprensentative.dsl diff --git a/python/knext/examples/supplychain1/schema/concept.rule b/python/knext/knext/examples/supplychain1/schema/concept.rule similarity index 100% rename from python/knext/examples/supplychain1/schema/concept.rule rename to python/knext/knext/examples/supplychain1/schema/concept.rule diff --git a/python/knext/examples/supplychain1/schema/supplychain.schema b/python/knext/knext/examples/supplychain1/schema/supplychain.schema similarity index 100% rename from python/knext/examples/supplychain1/schema/supplychain.schema rename to python/knext/knext/examples/supplychain1/schema/supplychain.schema diff --git a/python/knext/examples/supplychain1/schema/supplychain_schema_helper.py b/python/knext/knext/examples/supplychain1/schema/supplychain_schema_helper.py similarity index 100% rename from python/knext/examples/supplychain1/schema/supplychain_schema_helper.py rename to python/knext/knext/examples/supplychain1/schema/supplychain_schema_helper.py diff --git a/python/knext/operator/__init__.py b/python/knext/knext/operator/__init__.py similarity index 100% rename from python/knext/operator/__init__.py rename to python/knext/knext/operator/__init__.py diff --git a/python/knext/operator/base.py b/python/knext/knext/operator/base.py similarity index 100% rename from python/knext/operator/base.py rename to python/knext/knext/operator/base.py diff --git a/python/knext/operator/builtin/__init__.py b/python/knext/knext/operator/builtin/__init__.py similarity index 100% rename from python/knext/operator/builtin/__init__.py rename to python/knext/knext/operator/builtin/__init__.py diff --git a/python/knext/operator/builtin/auto_prompt.py b/python/knext/knext/operator/builtin/auto_prompt.py similarity index 100% rename from python/knext/operator/builtin/auto_prompt.py rename to python/knext/knext/operator/builtin/auto_prompt.py diff --git a/python/knext/operator/builtin/online_runner.py b/python/knext/knext/operator/builtin/online_runner.py similarity index 100% rename from python/knext/operator/builtin/online_runner.py rename to python/knext/knext/operator/builtin/online_runner.py diff --git a/python/knext/operator/invoke_result.py b/python/knext/knext/operator/invoke_result.py similarity index 100% rename from python/knext/operator/invoke_result.py rename to python/knext/knext/operator/invoke_result.py diff --git a/python/knext/operator/op.py b/python/knext/knext/operator/op.py similarity index 100% rename from python/knext/operator/op.py rename to python/knext/knext/operator/op.py diff --git a/python/knext/operator/spg_record.py b/python/knext/knext/operator/spg_record.py similarity index 100% rename from python/knext/operator/spg_record.py rename to python/knext/knext/operator/spg_record.py diff --git a/python/knext/rest/__init__.py b/python/knext/knext/rest/__init__.py similarity index 100% rename from python/knext/rest/__init__.py rename to python/knext/knext/rest/__init__.py diff --git a/python/knext/rest/api/__init__.py b/python/knext/knext/rest/api/__init__.py similarity index 100% rename from python/knext/rest/api/__init__.py rename to python/knext/knext/rest/api/__init__.py diff --git a/python/knext/rest/api/builder_api.py b/python/knext/knext/rest/api/builder_api.py similarity index 100% rename from python/knext/rest/api/builder_api.py rename to python/knext/knext/rest/api/builder_api.py diff --git a/python/knext/rest/api/concept_api.py b/python/knext/knext/rest/api/concept_api.py similarity index 100% rename from python/knext/rest/api/concept_api.py rename to python/knext/knext/rest/api/concept_api.py diff --git a/python/knext/rest/api/editor_api.py b/python/knext/knext/rest/api/editor_api.py similarity index 100% rename from python/knext/rest/api/editor_api.py rename to python/knext/knext/rest/api/editor_api.py diff --git a/python/knext/rest/api/object_store_api.py b/python/knext/knext/rest/api/object_store_api.py similarity index 100% rename from python/knext/rest/api/object_store_api.py rename to python/knext/knext/rest/api/object_store_api.py diff --git a/python/knext/rest/api/operator_api.py b/python/knext/knext/rest/api/operator_api.py similarity index 100% rename from python/knext/rest/api/operator_api.py rename to python/knext/knext/rest/api/operator_api.py diff --git a/python/knext/rest/api/project_api.py b/python/knext/knext/rest/api/project_api.py similarity index 100% rename from python/knext/rest/api/project_api.py rename to python/knext/knext/rest/api/project_api.py diff --git a/python/knext/rest/api/reasoner_api.py b/python/knext/knext/rest/api/reasoner_api.py similarity index 100% rename from python/knext/rest/api/reasoner_api.py rename to python/knext/knext/rest/api/reasoner_api.py diff --git a/python/knext/rest/api/schema_api.py b/python/knext/knext/rest/api/schema_api.py similarity index 100% rename from python/knext/rest/api/schema_api.py rename to python/knext/knext/rest/api/schema_api.py diff --git a/python/knext/rest/api/table_store_api.py b/python/knext/knext/rest/api/table_store_api.py similarity index 100% rename from python/knext/rest/api/table_store_api.py rename to python/knext/knext/rest/api/table_store_api.py diff --git a/python/knext/rest/api_client.py b/python/knext/knext/rest/api_client.py similarity index 100% rename from python/knext/rest/api_client.py rename to python/knext/knext/rest/api_client.py diff --git a/python/knext/rest/configuration.py b/python/knext/knext/rest/configuration.py similarity index 100% rename from python/knext/rest/configuration.py rename to python/knext/knext/rest/configuration.py diff --git a/python/knext/rest/exceptions.py b/python/knext/knext/rest/exceptions.py similarity index 100% rename from python/knext/rest/exceptions.py rename to python/knext/knext/rest/exceptions.py diff --git a/python/knext/rest/models/__init__.py b/python/knext/knext/rest/models/__init__.py similarity index 100% rename from python/knext/rest/models/__init__.py rename to python/knext/knext/rest/models/__init__.py diff --git a/python/knext/rest/models/builder/__init__.py b/python/knext/knext/rest/models/builder/__init__.py similarity index 100% rename from python/knext/rest/models/builder/__init__.py rename to python/knext/knext/rest/models/builder/__init__.py diff --git a/python/knext/rest/models/builder/pipeline/__init__.py b/python/knext/knext/rest/models/builder/pipeline/__init__.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/__init__.py rename to python/knext/knext/rest/models/builder/pipeline/__init__.py diff --git a/python/knext/rest/models/builder/pipeline/config/__init__.py b/python/knext/knext/rest/models/builder/pipeline/config/__init__.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/__init__.py rename to python/knext/knext/rest/models/builder/pipeline/config/__init__.py diff --git a/python/knext/rest/models/builder/pipeline/config/base_fusing_config.py b/python/knext/knext/rest/models/builder/pipeline/config/base_fusing_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/base_fusing_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/base_fusing_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/base_linking_config.py b/python/knext/knext/rest/models/builder/pipeline/config/base_linking_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/base_linking_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/base_linking_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/base_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/base_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/base_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/base_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/base_predicting_config.py b/python/knext/knext/rest/models/builder/pipeline/config/base_predicting_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/base_predicting_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/base_predicting_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/base_strategy_config.py b/python/knext/knext/rest/models/builder/pipeline/config/base_strategy_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/base_strategy_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/base_strategy_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/csv_source_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/csv_source_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/csv_source_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/csv_source_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/graph_store_sink_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/graph_store_sink_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/graph_store_sink_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/graph_store_sink_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/id_equals_linking_config.py b/python/knext/knext/rest/models/builder/pipeline/config/id_equals_linking_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/id_equals_linking_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/id_equals_linking_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/llm_based_extract_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/llm_based_extract_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/llm_based_extract_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/llm_based_extract_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/mapping_config.py b/python/knext/knext/rest/models/builder/pipeline/config/mapping_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/mapping_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/mapping_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/mapping_filter.py b/python/knext/knext/rest/models/builder/pipeline/config/mapping_filter.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/mapping_filter.py rename to python/knext/knext/rest/models/builder/pipeline/config/mapping_filter.py diff --git a/python/knext/rest/models/builder/pipeline/config/new_instance_fusing_config.py b/python/knext/knext/rest/models/builder/pipeline/config/new_instance_fusing_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/new_instance_fusing_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/new_instance_fusing_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/operator_config.py b/python/knext/knext/rest/models/builder/pipeline/config/operator_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/operator_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/operator_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/operator_fusing_config.py b/python/knext/knext/rest/models/builder/pipeline/config/operator_fusing_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/operator_fusing_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/operator_fusing_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/operator_linking_config.py b/python/knext/knext/rest/models/builder/pipeline/config/operator_linking_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/operator_linking_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/operator_linking_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/operator_predicting_config.py b/python/knext/knext/rest/models/builder/pipeline/config/operator_predicting_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/operator_predicting_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/operator_predicting_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/predicting_config.py b/python/knext/knext/rest/models/builder/pipeline/config/predicting_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/predicting_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/predicting_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/relation_mapping_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/relation_mapping_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/relation_mapping_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/relation_mapping_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/spg_type_mapping_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/spg_type_mapping_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/spg_type_mapping_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/spg_type_mapping_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/sub_graph_mapping_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/sub_graph_mapping_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/sub_graph_mapping_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/sub_graph_mapping_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/config/user_defined_extract_node_config.py b/python/knext/knext/rest/models/builder/pipeline/config/user_defined_extract_node_config.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/config/user_defined_extract_node_config.py rename to python/knext/knext/rest/models/builder/pipeline/config/user_defined_extract_node_config.py diff --git a/python/knext/rest/models/builder/pipeline/edge.py b/python/knext/knext/rest/models/builder/pipeline/edge.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/edge.py rename to python/knext/knext/rest/models/builder/pipeline/edge.py diff --git a/python/knext/rest/models/builder/pipeline/node.py b/python/knext/knext/rest/models/builder/pipeline/node.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/node.py rename to python/knext/knext/rest/models/builder/pipeline/node.py diff --git a/python/knext/rest/models/builder/pipeline/pipeline.py b/python/knext/knext/rest/models/builder/pipeline/pipeline.py similarity index 100% rename from python/knext/rest/models/builder/pipeline/pipeline.py rename to python/knext/knext/rest/models/builder/pipeline/pipeline.py diff --git a/python/knext/rest/models/builder/request/__init__.py b/python/knext/knext/rest/models/builder/request/__init__.py similarity index 100% rename from python/knext/rest/models/builder/request/__init__.py rename to python/knext/knext/rest/models/builder/request/__init__.py diff --git a/python/knext/rest/models/builder/request/builder_job_submit_request.py b/python/knext/knext/rest/models/builder/request/builder_job_submit_request.py similarity index 100% rename from python/knext/rest/models/builder/request/builder_job_submit_request.py rename to python/knext/knext/rest/models/builder/request/builder_job_submit_request.py diff --git a/python/knext/rest/models/builder/response/__init__.py b/python/knext/knext/rest/models/builder/response/__init__.py similarity index 100% rename from python/knext/rest/models/builder/response/__init__.py rename to python/knext/knext/rest/models/builder/response/__init__.py diff --git a/python/knext/rest/models/builder/response/base_builder_receipt.py b/python/knext/knext/rest/models/builder/response/base_builder_receipt.py similarity index 100% rename from python/knext/rest/models/builder/response/base_builder_receipt.py rename to python/knext/knext/rest/models/builder/response/base_builder_receipt.py diff --git a/python/knext/rest/models/builder/response/base_builder_result.py b/python/knext/knext/rest/models/builder/response/base_builder_result.py similarity index 100% rename from python/knext/rest/models/builder/response/base_builder_result.py rename to python/knext/knext/rest/models/builder/response/base_builder_result.py diff --git a/python/knext/rest/models/builder/response/builder_job_inst.py b/python/knext/knext/rest/models/builder/response/builder_job_inst.py similarity index 100% rename from python/knext/rest/models/builder/response/builder_job_inst.py rename to python/knext/knext/rest/models/builder/response/builder_job_inst.py diff --git a/python/knext/rest/models/builder/response/failure_builder_result.py b/python/knext/knext/rest/models/builder/response/failure_builder_result.py similarity index 100% rename from python/knext/rest/models/builder/response/failure_builder_result.py rename to python/knext/knext/rest/models/builder/response/failure_builder_result.py diff --git a/python/knext/rest/models/builder/response/job_builder_receipt.py b/python/knext/knext/rest/models/builder/response/job_builder_receipt.py similarity index 100% rename from python/knext/rest/models/builder/response/job_builder_receipt.py rename to python/knext/knext/rest/models/builder/response/job_builder_receipt.py diff --git a/python/knext/rest/models/builder/response/success_builder_result.py b/python/knext/knext/rest/models/builder/response/success_builder_result.py similarity index 100% rename from python/knext/rest/models/builder/response/success_builder_result.py rename to python/knext/knext/rest/models/builder/response/success_builder_result.py diff --git a/python/knext/rest/models/common/__init__.py b/python/knext/knext/rest/models/common/__init__.py similarity index 100% rename from python/knext/rest/models/common/__init__.py rename to python/knext/knext/rest/models/common/__init__.py diff --git a/python/knext/rest/models/common/user_info.py b/python/knext/knext/rest/models/common/user_info.py similarity index 100% rename from python/knext/rest/models/common/user_info.py rename to python/knext/knext/rest/models/common/user_info.py diff --git a/python/knext/rest/models/operator/__init__.py b/python/knext/knext/rest/models/operator/__init__.py similarity index 100% rename from python/knext/rest/models/operator/__init__.py rename to python/knext/knext/rest/models/operator/__init__.py diff --git a/python/knext/rest/models/operator/operator_overview.py b/python/knext/knext/rest/models/operator/operator_overview.py similarity index 100% rename from python/knext/rest/models/operator/operator_overview.py rename to python/knext/knext/rest/models/operator/operator_overview.py diff --git a/python/knext/rest/models/operator/operator_version.py b/python/knext/knext/rest/models/operator/operator_version.py similarity index 100% rename from python/knext/rest/models/operator/operator_version.py rename to python/knext/knext/rest/models/operator/operator_version.py diff --git a/python/knext/rest/models/reasoner/__init__.py b/python/knext/knext/rest/models/reasoner/__init__.py similarity index 100% rename from python/knext/rest/models/reasoner/__init__.py rename to python/knext/knext/rest/models/reasoner/__init__.py diff --git a/python/knext/rest/models/reasoner/request/__init__.py b/python/knext/knext/rest/models/reasoner/request/__init__.py similarity index 100% rename from python/knext/rest/models/reasoner/request/__init__.py rename to python/knext/knext/rest/models/reasoner/request/__init__.py diff --git a/python/knext/rest/models/reasoner/request/base_reasoner_content.py b/python/knext/knext/rest/models/reasoner/request/base_reasoner_content.py similarity index 100% rename from python/knext/rest/models/reasoner/request/base_reasoner_content.py rename to python/knext/knext/rest/models/reasoner/request/base_reasoner_content.py diff --git a/python/knext/rest/models/reasoner/request/kgdsl_reasoner_content.py b/python/knext/knext/rest/models/reasoner/request/kgdsl_reasoner_content.py similarity index 100% rename from python/knext/rest/models/reasoner/request/kgdsl_reasoner_content.py rename to python/knext/knext/rest/models/reasoner/request/kgdsl_reasoner_content.py diff --git a/python/knext/rest/models/reasoner/request/reasoner_dsl_run_request.py b/python/knext/knext/rest/models/reasoner/request/reasoner_dsl_run_request.py similarity index 100% rename from python/knext/rest/models/reasoner/request/reasoner_dsl_run_request.py rename to python/knext/knext/rest/models/reasoner/request/reasoner_dsl_run_request.py diff --git a/python/knext/rest/models/reasoner/request/reasoner_job_submit_request.py b/python/knext/knext/rest/models/reasoner/request/reasoner_job_submit_request.py similarity index 100% rename from python/knext/rest/models/reasoner/request/reasoner_job_submit_request.py rename to python/knext/knext/rest/models/reasoner/request/reasoner_job_submit_request.py diff --git a/python/knext/rest/models/reasoner/request/vertex_reasoner_content.py b/python/knext/knext/rest/models/reasoner/request/vertex_reasoner_content.py similarity index 100% rename from python/knext/rest/models/reasoner/request/vertex_reasoner_content.py rename to python/knext/knext/rest/models/reasoner/request/vertex_reasoner_content.py diff --git a/python/knext/rest/models/reasoner/response/__init__.py b/python/knext/knext/rest/models/reasoner/response/__init__.py similarity index 100% rename from python/knext/rest/models/reasoner/response/__init__.py rename to python/knext/knext/rest/models/reasoner/response/__init__.py diff --git a/python/knext/rest/models/reasoner/response/base_reasoner_receipt.py b/python/knext/knext/rest/models/reasoner/response/base_reasoner_receipt.py similarity index 100% rename from python/knext/rest/models/reasoner/response/base_reasoner_receipt.py rename to python/knext/knext/rest/models/reasoner/response/base_reasoner_receipt.py diff --git a/python/knext/rest/models/reasoner/response/base_reasoner_result.py b/python/knext/knext/rest/models/reasoner/response/base_reasoner_result.py similarity index 100% rename from python/knext/rest/models/reasoner/response/base_reasoner_result.py rename to python/knext/knext/rest/models/reasoner/response/base_reasoner_result.py diff --git a/python/knext/rest/models/reasoner/response/failure_reasoner_result.py b/python/knext/knext/rest/models/reasoner/response/failure_reasoner_result.py similarity index 100% rename from python/knext/rest/models/reasoner/response/failure_reasoner_result.py rename to python/knext/knext/rest/models/reasoner/response/failure_reasoner_result.py diff --git a/python/knext/rest/models/reasoner/response/job_reasoner_receipt.py b/python/knext/knext/rest/models/reasoner/response/job_reasoner_receipt.py similarity index 100% rename from python/knext/rest/models/reasoner/response/job_reasoner_receipt.py rename to python/knext/knext/rest/models/reasoner/response/job_reasoner_receipt.py diff --git a/python/knext/rest/models/reasoner/response/reasoner_job_inst.py b/python/knext/knext/rest/models/reasoner/response/reasoner_job_inst.py similarity index 100% rename from python/knext/rest/models/reasoner/response/reasoner_job_inst.py rename to python/knext/knext/rest/models/reasoner/response/reasoner_job_inst.py diff --git a/python/knext/rest/models/reasoner/response/success_reasoner_result.py b/python/knext/knext/rest/models/reasoner/response/success_reasoner_result.py similarity index 100% rename from python/knext/rest/models/reasoner/response/success_reasoner_result.py rename to python/knext/knext/rest/models/reasoner/response/success_reasoner_result.py diff --git a/python/knext/rest/models/reasoner/response/table_reasoner_receipt.py b/python/knext/knext/rest/models/reasoner/response/table_reasoner_receipt.py similarity index 100% rename from python/knext/rest/models/reasoner/response/table_reasoner_receipt.py rename to python/knext/knext/rest/models/reasoner/response/table_reasoner_receipt.py diff --git a/python/knext/rest/models/reasoner/starting_vertex.py b/python/knext/knext/rest/models/reasoner/starting_vertex.py similarity index 100% rename from python/knext/rest/models/reasoner/starting_vertex.py rename to python/knext/knext/rest/models/reasoner/starting_vertex.py diff --git a/python/knext/rest/models/request/__init__.py b/python/knext/knext/rest/models/request/__init__.py similarity index 100% rename from python/knext/rest/models/request/__init__.py rename to python/knext/knext/rest/models/request/__init__.py diff --git a/python/knext/rest/models/request/define_dynamic_taxonomy_request.py b/python/knext/knext/rest/models/request/define_dynamic_taxonomy_request.py similarity index 100% rename from python/knext/rest/models/request/define_dynamic_taxonomy_request.py rename to python/knext/knext/rest/models/request/define_dynamic_taxonomy_request.py diff --git a/python/knext/rest/models/request/define_logical_causation_request.py b/python/knext/knext/rest/models/request/define_logical_causation_request.py similarity index 100% rename from python/knext/rest/models/request/define_logical_causation_request.py rename to python/knext/knext/rest/models/request/define_logical_causation_request.py diff --git a/python/knext/rest/models/request/operator_create_request.py b/python/knext/knext/rest/models/request/operator_create_request.py similarity index 100% rename from python/knext/rest/models/request/operator_create_request.py rename to python/knext/knext/rest/models/request/operator_create_request.py diff --git a/python/knext/rest/models/request/operator_version_request.py b/python/knext/knext/rest/models/request/operator_version_request.py similarity index 100% rename from python/knext/rest/models/request/operator_version_request.py rename to python/knext/knext/rest/models/request/operator_version_request.py diff --git a/python/knext/rest/models/request/project_create_request.py b/python/knext/knext/rest/models/request/project_create_request.py similarity index 100% rename from python/knext/rest/models/request/project_create_request.py rename to python/knext/knext/rest/models/request/project_create_request.py diff --git a/python/knext/rest/models/request/remove_dynamic_taxonomy_request.py b/python/knext/knext/rest/models/request/remove_dynamic_taxonomy_request.py similarity index 100% rename from python/knext/rest/models/request/remove_dynamic_taxonomy_request.py rename to python/knext/knext/rest/models/request/remove_dynamic_taxonomy_request.py diff --git a/python/knext/rest/models/request/remove_logical_causation_request.py b/python/knext/knext/rest/models/request/remove_logical_causation_request.py similarity index 100% rename from python/knext/rest/models/request/remove_logical_causation_request.py rename to python/knext/knext/rest/models/request/remove_logical_causation_request.py diff --git a/python/knext/rest/models/request/schema_alter_request.py b/python/knext/knext/rest/models/request/schema_alter_request.py similarity index 100% rename from python/knext/rest/models/request/schema_alter_request.py rename to python/knext/knext/rest/models/request/schema_alter_request.py diff --git a/python/knext/rest/models/response/__init__.py b/python/knext/knext/rest/models/response/__init__.py similarity index 100% rename from python/knext/rest/models/response/__init__.py rename to python/knext/knext/rest/models/response/__init__.py diff --git a/python/knext/rest/models/response/object_store_response.py b/python/knext/knext/rest/models/response/object_store_response.py similarity index 100% rename from python/knext/rest/models/response/object_store_response.py rename to python/knext/knext/rest/models/response/object_store_response.py diff --git a/python/knext/rest/models/response/operator_create_response.py b/python/knext/knext/rest/models/response/operator_create_response.py similarity index 100% rename from python/knext/rest/models/response/operator_create_response.py rename to python/knext/knext/rest/models/response/operator_create_response.py diff --git a/python/knext/rest/models/response/operator_version_response.py b/python/knext/knext/rest/models/response/operator_version_response.py similarity index 100% rename from python/knext/rest/models/response/operator_version_response.py rename to python/knext/knext/rest/models/response/operator_version_response.py diff --git a/python/knext/rest/models/response/project.py b/python/knext/knext/rest/models/response/project.py similarity index 100% rename from python/knext/rest/models/response/project.py rename to python/knext/knext/rest/models/response/project.py diff --git a/python/knext/rest/models/response/search_engine_index_response.py b/python/knext/knext/rest/models/response/search_engine_index_response.py similarity index 100% rename from python/knext/rest/models/response/search_engine_index_response.py rename to python/knext/knext/rest/models/response/search_engine_index_response.py diff --git a/python/knext/rest/models/schema/__init__.py b/python/knext/knext/rest/models/schema/__init__.py similarity index 100% rename from python/knext/rest/models/schema/__init__.py rename to python/knext/knext/rest/models/schema/__init__.py diff --git a/python/knext/rest/models/schema/alter/__init__.py b/python/knext/knext/rest/models/schema/alter/__init__.py similarity index 100% rename from python/knext/rest/models/schema/alter/__init__.py rename to python/knext/knext/rest/models/schema/alter/__init__.py diff --git a/python/knext/rest/models/schema/alter/schema_draft.py b/python/knext/knext/rest/models/schema/alter/schema_draft.py similarity index 100% rename from python/knext/rest/models/schema/alter/schema_draft.py rename to python/knext/knext/rest/models/schema/alter/schema_draft.py diff --git a/python/knext/rest/models/schema/base_ontology.py b/python/knext/knext/rest/models/schema/base_ontology.py similarity index 100% rename from python/knext/rest/models/schema/base_ontology.py rename to python/knext/knext/rest/models/schema/base_ontology.py diff --git a/python/knext/rest/models/schema/basic_info.py b/python/knext/knext/rest/models/schema/basic_info.py similarity index 100% rename from python/knext/rest/models/schema/basic_info.py rename to python/knext/knext/rest/models/schema/basic_info.py diff --git a/python/knext/rest/models/schema/constraint/__init__.py b/python/knext/knext/rest/models/schema/constraint/__init__.py similarity index 100% rename from python/knext/rest/models/schema/constraint/__init__.py rename to python/knext/knext/rest/models/schema/constraint/__init__.py diff --git a/python/knext/rest/models/schema/constraint/base_constraint_item.py b/python/knext/knext/rest/models/schema/constraint/base_constraint_item.py similarity index 100% rename from python/knext/rest/models/schema/constraint/base_constraint_item.py rename to python/knext/knext/rest/models/schema/constraint/base_constraint_item.py diff --git a/python/knext/rest/models/schema/constraint/constraint.py b/python/knext/knext/rest/models/schema/constraint/constraint.py similarity index 100% rename from python/knext/rest/models/schema/constraint/constraint.py rename to python/knext/knext/rest/models/schema/constraint/constraint.py diff --git a/python/knext/rest/models/schema/constraint/enum_constraint.py b/python/knext/knext/rest/models/schema/constraint/enum_constraint.py similarity index 100% rename from python/knext/rest/models/schema/constraint/enum_constraint.py rename to python/knext/knext/rest/models/schema/constraint/enum_constraint.py diff --git a/python/knext/rest/models/schema/constraint/multi_val_constraint.py b/python/knext/knext/rest/models/schema/constraint/multi_val_constraint.py similarity index 100% rename from python/knext/rest/models/schema/constraint/multi_val_constraint.py rename to python/knext/knext/rest/models/schema/constraint/multi_val_constraint.py diff --git a/python/knext/rest/models/schema/constraint/not_null_constraint.py b/python/knext/knext/rest/models/schema/constraint/not_null_constraint.py similarity index 100% rename from python/knext/rest/models/schema/constraint/not_null_constraint.py rename to python/knext/knext/rest/models/schema/constraint/not_null_constraint.py diff --git a/python/knext/rest/models/schema/constraint/regular_constraint.py b/python/knext/knext/rest/models/schema/constraint/regular_constraint.py similarity index 100% rename from python/knext/rest/models/schema/constraint/regular_constraint.py rename to python/knext/knext/rest/models/schema/constraint/regular_constraint.py diff --git a/python/knext/rest/models/schema/identifier/__init__.py b/python/knext/knext/rest/models/schema/identifier/__init__.py similarity index 100% rename from python/knext/rest/models/schema/identifier/__init__.py rename to python/knext/knext/rest/models/schema/identifier/__init__.py diff --git a/python/knext/rest/models/schema/identifier/base_spg_identifier.py b/python/knext/knext/rest/models/schema/identifier/base_spg_identifier.py similarity index 100% rename from python/knext/rest/models/schema/identifier/base_spg_identifier.py rename to python/knext/knext/rest/models/schema/identifier/base_spg_identifier.py diff --git a/python/knext/rest/models/schema/identifier/concept_identifier.py b/python/knext/knext/rest/models/schema/identifier/concept_identifier.py similarity index 100% rename from python/knext/rest/models/schema/identifier/concept_identifier.py rename to python/knext/knext/rest/models/schema/identifier/concept_identifier.py diff --git a/python/knext/rest/models/schema/identifier/operator_identifier.py b/python/knext/knext/rest/models/schema/identifier/operator_identifier.py similarity index 100% rename from python/knext/rest/models/schema/identifier/operator_identifier.py rename to python/knext/knext/rest/models/schema/identifier/operator_identifier.py diff --git a/python/knext/rest/models/schema/identifier/predicate_identifier.py b/python/knext/knext/rest/models/schema/identifier/predicate_identifier.py similarity index 100% rename from python/knext/rest/models/schema/identifier/predicate_identifier.py rename to python/knext/knext/rest/models/schema/identifier/predicate_identifier.py diff --git a/python/knext/rest/models/schema/identifier/spg_triple_identifier.py b/python/knext/knext/rest/models/schema/identifier/spg_triple_identifier.py similarity index 100% rename from python/knext/rest/models/schema/identifier/spg_triple_identifier.py rename to python/knext/knext/rest/models/schema/identifier/spg_triple_identifier.py diff --git a/python/knext/rest/models/schema/identifier/spg_type_identifier.py b/python/knext/knext/rest/models/schema/identifier/spg_type_identifier.py similarity index 100% rename from python/knext/rest/models/schema/identifier/spg_type_identifier.py rename to python/knext/knext/rest/models/schema/identifier/spg_type_identifier.py diff --git a/python/knext/rest/models/schema/ontology_id.py b/python/knext/knext/rest/models/schema/ontology_id.py similarity index 100% rename from python/knext/rest/models/schema/ontology_id.py rename to python/knext/knext/rest/models/schema/ontology_id.py diff --git a/python/knext/rest/models/schema/predicate/__init__.py b/python/knext/knext/rest/models/schema/predicate/__init__.py similarity index 100% rename from python/knext/rest/models/schema/predicate/__init__.py rename to python/knext/knext/rest/models/schema/predicate/__init__.py diff --git a/python/knext/rest/models/schema/predicate/mounted_concept_config.py b/python/knext/knext/rest/models/schema/predicate/mounted_concept_config.py similarity index 100% rename from python/knext/rest/models/schema/predicate/mounted_concept_config.py rename to python/knext/knext/rest/models/schema/predicate/mounted_concept_config.py diff --git a/python/knext/rest/models/schema/predicate/property.py b/python/knext/knext/rest/models/schema/predicate/property.py similarity index 100% rename from python/knext/rest/models/schema/predicate/property.py rename to python/knext/knext/rest/models/schema/predicate/property.py diff --git a/python/knext/rest/models/schema/predicate/property_advanced_config.py b/python/knext/knext/rest/models/schema/predicate/property_advanced_config.py similarity index 100% rename from python/knext/rest/models/schema/predicate/property_advanced_config.py rename to python/knext/knext/rest/models/schema/predicate/property_advanced_config.py diff --git a/python/knext/rest/models/schema/predicate/property_ref.py b/python/knext/knext/rest/models/schema/predicate/property_ref.py similarity index 100% rename from python/knext/rest/models/schema/predicate/property_ref.py rename to python/knext/knext/rest/models/schema/predicate/property_ref.py diff --git a/python/knext/rest/models/schema/predicate/property_ref_basic_info.py b/python/knext/knext/rest/models/schema/predicate/property_ref_basic_info.py similarity index 100% rename from python/knext/rest/models/schema/predicate/property_ref_basic_info.py rename to python/knext/knext/rest/models/schema/predicate/property_ref_basic_info.py diff --git a/python/knext/rest/models/schema/predicate/relation.py b/python/knext/knext/rest/models/schema/predicate/relation.py similarity index 100% rename from python/knext/rest/models/schema/predicate/relation.py rename to python/knext/knext/rest/models/schema/predicate/relation.py diff --git a/python/knext/rest/models/schema/predicate/sub_property.py b/python/knext/knext/rest/models/schema/predicate/sub_property.py similarity index 100% rename from python/knext/rest/models/schema/predicate/sub_property.py rename to python/knext/knext/rest/models/schema/predicate/sub_property.py diff --git a/python/knext/rest/models/schema/predicate/sub_property_basic_info.py b/python/knext/knext/rest/models/schema/predicate/sub_property_basic_info.py similarity index 100% rename from python/knext/rest/models/schema/predicate/sub_property_basic_info.py rename to python/knext/knext/rest/models/schema/predicate/sub_property_basic_info.py diff --git a/python/knext/rest/models/schema/semantic/__init__.py b/python/knext/knext/rest/models/schema/semantic/__init__.py similarity index 100% rename from python/knext/rest/models/schema/semantic/__init__.py rename to python/knext/knext/rest/models/schema/semantic/__init__.py diff --git a/python/knext/rest/models/schema/semantic/base_semantic.py b/python/knext/knext/rest/models/schema/semantic/base_semantic.py similarity index 100% rename from python/knext/rest/models/schema/semantic/base_semantic.py rename to python/knext/knext/rest/models/schema/semantic/base_semantic.py diff --git a/python/knext/rest/models/schema/semantic/logical_rule.py b/python/knext/knext/rest/models/schema/semantic/logical_rule.py similarity index 100% rename from python/knext/rest/models/schema/semantic/logical_rule.py rename to python/knext/knext/rest/models/schema/semantic/logical_rule.py diff --git a/python/knext/rest/models/schema/semantic/predicate_semantic.py b/python/knext/knext/rest/models/schema/semantic/predicate_semantic.py similarity index 100% rename from python/knext/rest/models/schema/semantic/predicate_semantic.py rename to python/knext/knext/rest/models/schema/semantic/predicate_semantic.py diff --git a/python/knext/rest/models/schema/semantic/rule_code.py b/python/knext/knext/rest/models/schema/semantic/rule_code.py similarity index 100% rename from python/knext/rest/models/schema/semantic/rule_code.py rename to python/knext/knext/rest/models/schema/semantic/rule_code.py diff --git a/python/knext/rest/models/schema/type/__init__.py b/python/knext/knext/rest/models/schema/type/__init__.py similarity index 100% rename from python/knext/rest/models/schema/type/__init__.py rename to python/knext/knext/rest/models/schema/type/__init__.py diff --git a/python/knext/rest/models/schema/type/base_advanced_type.py b/python/knext/knext/rest/models/schema/type/base_advanced_type.py similarity index 100% rename from python/knext/rest/models/schema/type/base_advanced_type.py rename to python/knext/knext/rest/models/schema/type/base_advanced_type.py diff --git a/python/knext/rest/models/schema/type/base_spg_type.py b/python/knext/knext/rest/models/schema/type/base_spg_type.py similarity index 100% rename from python/knext/rest/models/schema/type/base_spg_type.py rename to python/knext/knext/rest/models/schema/type/base_spg_type.py diff --git a/python/knext/rest/models/schema/type/basic_type.py b/python/knext/knext/rest/models/schema/type/basic_type.py similarity index 100% rename from python/knext/rest/models/schema/type/basic_type.py rename to python/knext/knext/rest/models/schema/type/basic_type.py diff --git a/python/knext/rest/models/schema/type/concept_layer_config.py b/python/knext/knext/rest/models/schema/type/concept_layer_config.py similarity index 100% rename from python/knext/rest/models/schema/type/concept_layer_config.py rename to python/knext/knext/rest/models/schema/type/concept_layer_config.py diff --git a/python/knext/rest/models/schema/type/concept_taxonomic_config.py b/python/knext/knext/rest/models/schema/type/concept_taxonomic_config.py similarity index 100% rename from python/knext/rest/models/schema/type/concept_taxonomic_config.py rename to python/knext/knext/rest/models/schema/type/concept_taxonomic_config.py diff --git a/python/knext/rest/models/schema/type/concept_type.py b/python/knext/knext/rest/models/schema/type/concept_type.py similarity index 100% rename from python/knext/rest/models/schema/type/concept_type.py rename to python/knext/knext/rest/models/schema/type/concept_type.py diff --git a/python/knext/rest/models/schema/type/entity_type.py b/python/knext/knext/rest/models/schema/type/entity_type.py similarity index 100% rename from python/knext/rest/models/schema/type/entity_type.py rename to python/knext/knext/rest/models/schema/type/entity_type.py diff --git a/python/knext/rest/models/schema/type/event_type.py b/python/knext/knext/rest/models/schema/type/event_type.py similarity index 100% rename from python/knext/rest/models/schema/type/event_type.py rename to python/knext/knext/rest/models/schema/type/event_type.py diff --git a/python/knext/rest/models/schema/type/multi_version_config.py b/python/knext/knext/rest/models/schema/type/multi_version_config.py similarity index 100% rename from python/knext/rest/models/schema/type/multi_version_config.py rename to python/knext/knext/rest/models/schema/type/multi_version_config.py diff --git a/python/knext/rest/models/schema/type/operator_key.py b/python/knext/knext/rest/models/schema/type/operator_key.py similarity index 100% rename from python/knext/rest/models/schema/type/operator_key.py rename to python/knext/knext/rest/models/schema/type/operator_key.py diff --git a/python/knext/rest/models/schema/type/parent_type_info.py b/python/knext/knext/rest/models/schema/type/parent_type_info.py similarity index 100% rename from python/knext/rest/models/schema/type/parent_type_info.py rename to python/knext/knext/rest/models/schema/type/parent_type_info.py diff --git a/python/knext/rest/models/schema/type/project_schema.py b/python/knext/knext/rest/models/schema/type/project_schema.py similarity index 100% rename from python/knext/rest/models/schema/type/project_schema.py rename to python/knext/knext/rest/models/schema/type/project_schema.py diff --git a/python/knext/rest/models/schema/type/spg_type_advanced_config.py b/python/knext/knext/rest/models/schema/type/spg_type_advanced_config.py similarity index 100% rename from python/knext/rest/models/schema/type/spg_type_advanced_config.py rename to python/knext/knext/rest/models/schema/type/spg_type_advanced_config.py diff --git a/python/knext/rest/models/schema/type/spg_type_ref.py b/python/knext/knext/rest/models/schema/type/spg_type_ref.py similarity index 100% rename from python/knext/rest/models/schema/type/spg_type_ref.py rename to python/knext/knext/rest/models/schema/type/spg_type_ref.py diff --git a/python/knext/rest/models/schema/type/spg_type_ref_basic_info.py b/python/knext/knext/rest/models/schema/type/spg_type_ref_basic_info.py similarity index 100% rename from python/knext/rest/models/schema/type/spg_type_ref_basic_info.py rename to python/knext/knext/rest/models/schema/type/spg_type_ref_basic_info.py diff --git a/python/knext/rest/models/schema/type/standard_type.py b/python/knext/knext/rest/models/schema/type/standard_type.py similarity index 100% rename from python/knext/rest/models/schema/type/standard_type.py rename to python/knext/knext/rest/models/schema/type/standard_type.py diff --git a/python/knext/rest/models/schema/type/standard_type_basic_info.py b/python/knext/knext/rest/models/schema/type/standard_type_basic_info.py similarity index 100% rename from python/knext/rest/models/schema/type/standard_type_basic_info.py rename to python/knext/knext/rest/models/schema/type/standard_type_basic_info.py diff --git a/python/knext/rest/rest.py b/python/knext/knext/rest/rest.py similarity index 100% rename from python/knext/rest/rest.py rename to python/knext/knext/rest/rest.py diff --git a/python/knext/templates/project/.knext.cfg.tmpl b/python/knext/knext/templates/project/.knext.cfg.tmpl similarity index 100% rename from python/knext/templates/project/.knext.cfg.tmpl rename to python/knext/knext/templates/project/.knext.cfg.tmpl diff --git a/python/knext/templates/project/README.md.tmpl b/python/knext/knext/templates/project/README.md.tmpl similarity index 100% rename from python/knext/templates/project/README.md.tmpl rename to python/knext/knext/templates/project/README.md.tmpl diff --git a/python/knext/templates/project/builder/job/data/Demo.csv b/python/knext/knext/templates/project/builder/job/data/Demo.csv similarity index 100% rename from python/knext/templates/project/builder/job/data/Demo.csv rename to python/knext/knext/templates/project/builder/job/data/Demo.csv diff --git a/python/knext/templates/project/builder/job/demo.py.tmpl b/python/knext/knext/templates/project/builder/job/demo.py.tmpl similarity index 100% rename from python/knext/templates/project/builder/job/demo.py.tmpl rename to python/knext/knext/templates/project/builder/job/demo.py.tmpl diff --git a/python/knext/templates/project/builder/operator/demo_extract_op.py b/python/knext/knext/templates/project/builder/operator/demo_extract_op.py similarity index 100% rename from python/knext/templates/project/builder/operator/demo_extract_op.py rename to python/knext/knext/templates/project/builder/operator/demo_extract_op.py diff --git a/python/knext/templates/project/reasoner/demo.dsl.tmpl b/python/knext/knext/templates/project/reasoner/demo.dsl.tmpl similarity index 100% rename from python/knext/templates/project/reasoner/demo.dsl.tmpl rename to python/knext/knext/templates/project/reasoner/demo.dsl.tmpl diff --git a/python/knext/templates/project/schema/${project}.schema.tmpl b/python/knext/knext/templates/project/schema/${project}.schema.tmpl similarity index 100% rename from python/knext/templates/project/schema/${project}.schema.tmpl rename to python/knext/knext/templates/project/schema/${project}.schema.tmpl diff --git a/python/knext/templates/schema_helper/${project}_schema_helper.py.tmpl b/python/knext/knext/templates/schema_helper/${project}_schema_helper.py.tmpl similarity index 100% rename from python/knext/templates/schema_helper/${project}_schema_helper.py.tmpl rename to python/knext/knext/templates/schema_helper/${project}_schema_helper.py.tmpl diff --git a/python/medical/.knext.cfg b/python/knext/medical/.knext.cfg similarity index 100% rename from python/medical/.knext.cfg rename to python/knext/medical/.knext.cfg diff --git a/python/medical/builder/disease_chain.py b/python/knext/medical/builder/disease_chain.py similarity index 100% rename from python/medical/builder/disease_chain.py rename to python/knext/medical/builder/disease_chain.py diff --git a/python/medical/builder/job/data/BodyPart.csv b/python/knext/medical/builder/job/data/BodyPart.csv similarity index 100% rename from python/medical/builder/job/data/BodyPart.csv rename to python/knext/medical/builder/job/data/BodyPart.csv diff --git a/python/medical/builder/job/data/Disease.csv b/python/knext/medical/builder/job/data/Disease.csv similarity index 100% rename from python/medical/builder/job/data/Disease.csv rename to python/knext/medical/builder/job/data/Disease.csv diff --git a/python/medical/builder/job/data/HospitalDepartment.csv b/python/knext/medical/builder/job/data/HospitalDepartment.csv similarity index 100% rename from python/medical/builder/job/data/HospitalDepartment.csv rename to python/knext/medical/builder/job/data/HospitalDepartment.csv diff --git a/python/medical/builder/job/disease.py b/python/knext/medical/builder/job/disease.py similarity index 100% rename from python/medical/builder/job/disease.py rename to python/knext/medical/builder/job/disease.py diff --git a/python/medical/builder/job/openai_infer.json b/python/knext/medical/builder/job/openai_infer.json similarity index 100% rename from python/medical/builder/job/openai_infer.json rename to python/knext/medical/builder/job/openai_infer.json diff --git a/python/medical/builder/openai_infer.json b/python/knext/medical/builder/openai_infer.json similarity index 100% rename from python/medical/builder/openai_infer.json rename to python/knext/medical/builder/openai_infer.json diff --git a/python/medical/builder/operator/disease_extractor.py b/python/knext/medical/builder/operator/disease_extractor.py similarity index 100% rename from python/medical/builder/operator/disease_extractor.py rename to python/knext/medical/builder/operator/disease_extractor.py diff --git a/python/medical/schema/medical1.schema b/python/knext/medical/schema/medical1.schema similarity index 100% rename from python/medical/schema/medical1.schema rename to python/knext/medical/schema/medical1.schema diff --git a/python/medical/schema/medical1_schema_helper.py b/python/knext/medical/schema/medical1_schema_helper.py similarity index 100% rename from python/medical/schema/medical1_schema_helper.py rename to python/knext/medical/schema/medical1_schema_helper.py diff --git a/python/medical/schema/medical_schema_helper.py b/python/knext/medical/schema/medical_schema_helper.py similarity index 100% rename from python/medical/schema/medical_schema_helper.py rename to python/knext/medical/schema/medical_schema_helper.py diff --git a/python/medical/schema/prompt.json b/python/knext/medical/schema/prompt.json similarity index 100% rename from python/medical/schema/prompt.json rename to python/knext/medical/schema/prompt.json diff --git a/python/requirements.txt b/python/knext/requirements.txt similarity index 93% rename from python/requirements.txt rename to python/knext/requirements.txt index a9045edf..1ef8f248 100644 --- a/python/requirements.txt +++ b/python/knext/requirements.txt @@ -16,4 +16,4 @@ python-dateutil==2.8.2 networkx==3.1 pydantic==2.5.2 requests==2.31.0 -setuptools==60.2.0 \ No newline at end of file +setuptools==60.2.0 diff --git a/python/setup.py b/python/knext/setup.py similarity index 94% rename from python/setup.py rename to python/knext/setup.py index f2bafd88..6254993f 100644 --- a/python/setup.py +++ b/python/knext/setup.py @@ -26,7 +26,11 @@ license = "" with open(os.path.join(cwd, "LICENSE"), "r") as rf: line = rf.readline() while line: - license += "# " + line.strip() + "\n" + line = line.strip() + if line: + license += "# " + line + "\n" + else: + license += "#\n" line = rf.readline() # Generate knext.__init__.py diff --git a/python/tests/Disease.csv b/python/knext/tests/Disease.csv similarity index 100% rename from python/tests/Disease.csv rename to python/knext/tests/Disease.csv diff --git a/python/tests/__init__.py b/python/knext/tests/__init__.py similarity index 100% rename from python/tests/__init__.py rename to python/knext/tests/__init__.py diff --git a/python/tests/chain_test.py b/python/knext/tests/chain_test.py similarity index 100% rename from python/tests/chain_test.py rename to python/knext/tests/chain_test.py diff --git a/python/tests/disease_builder_job.py b/python/knext/tests/disease_builder_job.py similarity index 100% rename from python/tests/disease_builder_job.py rename to python/knext/tests/disease_builder_job.py diff --git a/python/tests/medical_case.py b/python/knext/tests/medical_case.py similarity index 100% rename from python/tests/medical_case.py rename to python/knext/tests/medical_case.py diff --git a/python/nn4k/.gitignore b/python/nn4k/.gitignore new file mode 100644 index 00000000..4baf9d4c --- /dev/null +++ b/python/nn4k/.gitignore @@ -0,0 +1,3 @@ +/*.whl +/*.egg-info/ +/build/ diff --git a/python/nn4k/LICENSE b/python/nn4k/LICENSE new file mode 100644 index 00000000..ff40fe57 --- /dev/null +++ b/python/nn4k/LICENSE @@ -0,0 +1,10 @@ +Copyright 2023 Ant Group CO., Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License +is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +or implied. diff --git a/python/nn4k/MANIFEST.in b/python/nn4k/MANIFEST.in new file mode 100644 index 00000000..b651e3f8 --- /dev/null +++ b/python/nn4k/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include nn4k * +recursive-exclude nn4k/examples * diff --git a/python/nn4k/NN4K_VERSION b/python/nn4k/NN4K_VERSION new file mode 100644 index 00000000..6adbd73c --- /dev/null +++ b/python/nn4k/NN4K_VERSION @@ -0,0 +1 @@ +0.0.1-beta2 diff --git a/python/nn4k/invoker/openai_invoker.py b/python/nn4k/invoker/openai_invoker.py deleted file mode 100644 index b5a422b0..00000000 --- a/python/nn4k/invoker/openai_invoker.py +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright 2023 Ant Group CO., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. - -from typing import Any -from typing import Union - -from nn4k.invoker import NNInvoker - - -class OpenAIInvoker(NNInvoker): - @classmethod - def _preprocess_config(cls, nn_config: Union[str, dict]) -> dict: - try: - if isinstance(nn_config, str): - with open(nn_config, "r") as f: - nn_config = json.load(f) - except: - raise ValueError("cannot decode config file") - return nn_config - - @classmethod - def _get_field(cls, nn_config: dict, name: str, text: str) -> Any: - value = nn_config.get(name) - if value is None: - message = "%s %r not found" % (text, name) - raise ValueError(message) - return value - - @classmethod - def _get_string_field(cls, nn_config: dict, name: str, text: str) -> str: - value = cls._get_field(nn_config, name, text) - if not isinstance(value, str): - message = "%s %r must be string; " % (text, name) - message += "%r is invalid" % (value,) - raise TypeError(message) - return value - - @classmethod - def _get_int_field(cls, nn_config: dict, name: str, text: str) -> int: - value = cls._get_field(nn_config, name, text) - if not isinstance(value, int): - message = "%s %r must be integer; " % (text, name) - message += "%r is invalid" % (value,) - raise TypeError(message) - return value - - @classmethod - def _get_positive_int_field(cls, nn_config: dict, name: str, text: str) -> int: - value = cls._get_int_field(nn_config, name, text) - if value <= 0: - message = "%s %r must be positive integer; " % (text, name) - message += "%r is invalid" % (value,) - raise ValueError(message) - return value - - @classmethod - def _parse_config(cls, nn_config: dict) -> dict: - openai_api_key = cls._get_string_field( - nn_config, "openai_api_key", "openai api key" - ) - openai_api_base = cls._get_string_field( - nn_config, "openai_api_base", "openai api base" - ) - openai_model_name = cls._get_string_field( - nn_config, "openai_model_name", "openai model name" - ) - openai_max_tokens = cls._get_positive_int_field( - nn_config, "openai_max_tokens", "openai max tokens" - ) - config = dict( - openai_api_key=openai_api_key, - openai_api_base=openai_api_base, - openai_model_name=openai_model_name, - openai_max_tokens=openai_max_tokens, - ) - return config - - @classmethod - def from_config(cls, nn_config: Union[str, dict]): - import openai - - nn_config = cls._preprocess_config(nn_config) - config = cls._parse_config(nn_config) - - o = cls.__new__(cls) - o._nn_config = nn_config - o._openai_api_key = config["openai_api_key"] - o._openai_api_base = config["openai_api_base"] - o._openai_model_name = config["openai_model_name"] - o._openai_max_tokens = config["openai_max_tokens"] - - openai.api_key = o._openai_api_key - openai.api_base = o._openai_api_base - return o - - def _create_prompt(self, input, **kwargs): - prompt = input - return prompt - - def _create_output(self, input, prompt, completion, **kwargs): - output = prompt + completion.choices[0].text - return output - - def remote_inference(self, input, **kwargs): - import openai - - prompt = self._create_prompt(input, **kwargs) - completion = openai.Completion.create( - model=self._openai_model_name, - prompt=prompt, - max_tokens=self._openai_max_tokens, - ) - output = self._create_output(input, prompt, completion, **kwargs) - return output diff --git a/python/nn4k/executor/hugging_face.py b/python/nn4k/nn4k/__init__.py similarity index 88% rename from python/nn4k/executor/hugging_face.py rename to python/nn4k/nn4k/__init__.py index 19913efa..57675292 100644 --- a/python/nn4k/executor/hugging_face.py +++ b/python/nn4k/nn4k/__init__.py @@ -8,3 +8,7 @@ # Unless required by applicable law or agreed to in writing, software distributed under the License # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. + + +__package_name__ = "openspg-nn4k" +__version__ = "0.0.1-beta2" diff --git a/python/nn4k/executor/__init__.py b/python/nn4k/nn4k/executor/__init__.py similarity index 100% rename from python/nn4k/executor/__init__.py rename to python/nn4k/nn4k/executor/__init__.py diff --git a/python/nn4k/executor/base.py b/python/nn4k/nn4k/executor/base.py similarity index 88% rename from python/nn4k/executor/base.py rename to python/nn4k/nn4k/executor/base.py index 0fc05537..799c5266 100644 --- a/python/nn4k/executor/base.py +++ b/python/nn4k/nn4k/executor/base.py @@ -36,8 +36,14 @@ class LLMExecutor(NNExecutor): nn_config """ - # TODO - pass + if "nn_name" in nn_config: + from nn4k.executor.hugging_face import HfLLMExecutor + + return HfLLMExecutor.from_config(nn_config) + else: + o = cls.__new__(cls) + o._nn_config = nn_config + return o @abstractmethod def execute_sft(self, args=None, callbacks=None, **kwargs): @@ -68,13 +74,3 @@ class LLMExecutor(NNExecutor): The entry point of inference. Usually for local invokers or model services. """ raise NotImplementedError() - - -class HfLLMExecutor(NNExecutor): - - pass - - -class DeepKeExecutor(NNExecutor): - - pass diff --git a/python/nn4k/executor/deepke.py b/python/nn4k/nn4k/executor/deepke.py similarity index 84% rename from python/nn4k/executor/deepke.py rename to python/nn4k/nn4k/executor/deepke.py index 19913efa..b837a68c 100644 --- a/python/nn4k/executor/deepke.py +++ b/python/nn4k/nn4k/executor/deepke.py @@ -8,3 +8,10 @@ # Unless required by applicable law or agreed to in writing, software distributed under the License # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. + +from nn4k.executor import NNExecutor + + +class DeepKeExecutor(NNExecutor): + + pass diff --git a/python/nn4k/nn4k/executor/hugging_face.py b/python/nn4k/nn4k/executor/hugging_face.py new file mode 100644 index 00000000..56be96f6 --- /dev/null +++ b/python/nn4k/nn4k/executor/hugging_face.py @@ -0,0 +1,120 @@ +# Copyright 2023 Ant Group CO., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. + +from nn4k.executor import NNExecutor + + +class HfLLMExecutor(NNExecutor): + @classmethod + def _parse_config(cls, nn_config: dict) -> dict: + from nn4k.utils.config_parsing import get_string_field + + nn_name = get_string_field(nn_config, "nn_name", "NN model name") + nn_version = get_string_field(nn_config, "nn_version", "NN model version") + config = dict( + nn_name=nn_name, + nn_version=nn_version, + ) + return config + + @classmethod + def from_config(cls, nn_config: dict): + config = cls._parse_config(nn_config) + + o = cls.__new__(cls) + o._nn_config = nn_config + o._nn_name = config["nn_name"] + o._nn_version = config["nn_version"] + o._nn_device = None + o._nn_tokenizer = None + o._nn_model = None + + return o + + def _load_model(self): + import torch + from transformers import AutoTokenizer + from transformers import AutoModelForCausalLM + + if self._nn_model is None: + model_path = self._nn_name + revision = self._nn_version + use_fast_tokenizer = False + device = self._nn_config.get("nn_device") + trust_remote_code = self._nn_config.get("nn_trust_remote_code", False) + if device is None: + device = "cuda" if torch.cuda.is_available() else "cpu" + tokenizer = AutoTokenizer.from_pretrained( + model_path, + use_fast=use_fast_tokenizer, + revision=revision, + trust_remote_code=trust_remote_code, + ) + model = AutoModelForCausalLM.from_pretrained( + model_path, + low_cpu_mem_usage=True, + torch_dtype=torch.float16, + revision=revision, + trust_remote_code=trust_remote_code, + ) + model.to(device) + self._nn_device = device + self._nn_tokenizer = tokenizer + self._nn_model = model + + def _get_tokenizer(self): + if self._nn_model is None: + self._load_model() + return self._nn_tokenizer + + def _get_model(self): + if self._nn_model is None: + self._load_model() + return self._nn_model + + def inference(self, data, **kwargs): + if "max_input_length" in kwargs: + max_input_length = kwargs.pop("max_input_length") + else: + max_input_length = 1024 + if "max_output_length" in kwargs: + max_output_length = kwargs.pop("max_output_length") + else: + max_output_length = 1024 + if "do_sample" in kwargs: + do_sample = kwargs.pop("do_sample") + else: + do_sample = False + nn_tokenizer = self._get_tokenizer() + nn_model = self._get_model() + input_ids = nn_tokenizer( + data, + padding=True, + return_token_type_ids=False, + return_tensors="pt", + truncation=True, + max_length=max_input_length, + ).to(self._nn_device) + output_ids = nn_model.generate( + **input_ids, + max_new_tokens=max_output_length, + do_sample=do_sample, + eos_token_id=nn_tokenizer.eos_token_id, + pad_token_id=nn_tokenizer.pad_token_id, + **kwargs + ) + outputs = [ + nn_tokenizer.decode( + output_id[len(input_ids["input_ids"][idx]) :], skip_special_tokens=True + ) + for idx, output_id in enumerate(output_ids) + ] + return outputs diff --git a/python/nn4k/invoker/__init__.py b/python/nn4k/nn4k/invoker/__init__.py similarity index 100% rename from python/nn4k/invoker/__init__.py rename to python/nn4k/nn4k/invoker/__init__.py diff --git a/python/nn4k/invoker/base.py b/python/nn4k/nn4k/invoker/base.py similarity index 85% rename from python/nn4k/invoker/base.py rename to python/nn4k/nn4k/invoker/base.py index 617fae27..67c4a017 100644 --- a/python/nn4k/invoker/base.py +++ b/python/nn4k/nn4k/invoker/base.py @@ -1,4 +1,3 @@ -# coding: utf-8 # Copyright 2023 Ant Group CO., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except @@ -10,8 +9,6 @@ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. -# Copyright (c) Antfin, Inc. All rights reserved. -import json import os from abc import ABC from typing import Union @@ -76,26 +73,30 @@ class LLMInvoker(NNInvoker): pass def local_inference(self, data, **kwargs): - self._nn_executor.inference(data, **kwargs) + return self._nn_executor.inference(data, **kwargs) def init_local_model(self): name = self._nn_config.get("nn_name") version = self._nn_config.get("nn_version") self._nn_executor: LLMExecutor = self.hub.get_model_executor(name, version) + def _publish_executors(self): + from nn4k.executor.hugging_face import HfLLMExecutor + + if "nn_name" in self._nn_config: + executor = HfLLMExecutor.from_config(self._nn_config) + self.hub.publish(executor, executor._nn_name, executor._nn_version) + @classmethod def from_config(cls, nn_config: Union[str, dict]): - try: - if isinstance(nn_config, str): - with open(nn_config, "r") as f: - nn_config = json.load(f) - except: - raise ValueError("cannot decode config file") + from nn4k.utils.config_parsing import preprocess_config + nn_config = preprocess_config(nn_config) if nn_config.get("invoker_type", "LLM") == "LLM": o = cls.__new__(cls) o._nn_config = nn_config + o._publish_executors() return o elif nn_config.get("invoker_type", "LLM") == "OpenAI": from nn4k.invoker.openai_invoker import OpenAIInvoker diff --git a/python/nn4k/nn4k/invoker/openai_invoker.py b/python/nn4k/nn4k/invoker/openai_invoker.py new file mode 100644 index 00000000..603692e4 --- /dev/null +++ b/python/nn4k/nn4k/invoker/openai_invoker.py @@ -0,0 +1,85 @@ +# Copyright 2023 Ant Group CO., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. + +from typing import Union + +from nn4k.invoker import NNInvoker + + +class OpenAIInvoker(NNInvoker): + @classmethod + def _parse_config(cls, nn_config: dict) -> dict: + from nn4k.utils.config_parsing import get_string_field + from nn4k.utils.config_parsing import get_positive_int_field + + openai_api_key = get_string_field(nn_config, "openai_api_key", "openai api key") + openai_api_base = get_string_field( + nn_config, "openai_api_base", "openai api base" + ) + openai_model_name = get_string_field( + nn_config, "openai_model_name", "openai model name" + ) + openai_max_tokens = get_positive_int_field( + nn_config, "openai_max_tokens", "openai max tokens" + ) + config = dict( + openai_api_key=openai_api_key, + openai_api_base=openai_api_base, + openai_model_name=openai_model_name, + openai_max_tokens=openai_max_tokens, + ) + return config + + @classmethod + def from_config(cls, nn_config: Union[str, dict]): + import openai + from nn4k.utils.config_parsing import preprocess_config + + nn_config = preprocess_config(nn_config) + config = cls._parse_config(nn_config) + + o = cls.__new__(cls) + o._nn_config = nn_config + o._openai_api_key = config["openai_api_key"] + o._openai_api_base = config["openai_api_base"] + o._openai_model_name = config["openai_model_name"] + o._openai_max_tokens = config["openai_max_tokens"] + + openai.api_key = o._openai_api_key + openai.api_base = o._openai_api_base + return o + + def _create_prompt(self, input, **kwargs): + if isinstance(input, list): + prompt = input + else: + prompt = [input] + return prompt + + def _create_output(self, input, prompt, completion, **kwargs): + output = [choice.text for choice in completion.choices] + return output + + def remote_inference(self, input, **kwargs): + import openai + + if "max_output_length" in kwargs: + max_output_length = kwargs.pop("max_output_length") + else: + max_output_length = self._openai_max_tokens + prompt = self._create_prompt(input, **kwargs) + completion = openai.Completion.create( + model=self._openai_model_name, + prompt=prompt, + max_tokens=max_output_length, + ) + output = self._create_output(input, prompt, completion, **kwargs) + return output diff --git a/python/nn4k/nnhub/__init__.py b/python/nn4k/nn4k/nnhub/__init__.py similarity index 100% rename from python/nn4k/nnhub/__init__.py rename to python/nn4k/nn4k/nnhub/__init__.py diff --git a/python/nn4k/__init__.py b/python/nn4k/nn4k/utils/__init__.py similarity index 100% rename from python/nn4k/__init__.py rename to python/nn4k/nn4k/utils/__init__.py diff --git a/python/nn4k/nn4k/utils/config_parsing.py b/python/nn4k/nn4k/utils/config_parsing.py new file mode 100644 index 00000000..98b23a69 --- /dev/null +++ b/python/nn4k/nn4k/utils/config_parsing.py @@ -0,0 +1,60 @@ +# Copyright 2023 Ant Group CO., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. + +import json + +from typing import Any +from typing import Union + + +def preprocess_config(nn_config: Union[str, dict]) -> dict: + try: + if isinstance(nn_config, str): + with open(nn_config, "r") as f: + nn_config = json.load(f) + except: + raise ValueError("cannot decode config file") + return nn_config + + +def get_field(nn_config: dict, name: str, text: str) -> Any: + value = nn_config.get(name) + if value is None: + message = "%s %r not found" % (text, name) + raise ValueError(message) + return value + + +def get_string_field(nn_config: dict, name: str, text: str) -> str: + value = get_field(nn_config, name, text) + if not isinstance(value, str): + message = "%s %r must be string; " % (text, name) + message += "%r is invalid" % (value,) + raise TypeError(message) + return value + + +def get_int_field(nn_config: dict, name: str, text: str) -> int: + value = get_field(nn_config, name, text) + if not isinstance(value, int): + message = "%s %r must be integer; " % (text, name) + message += "%r is invalid" % (value,) + raise TypeError(message) + return value + + +def get_positive_int_field(nn_config: dict, name: str, text: str) -> int: + value = get_int_field(nn_config, name, text) + if value <= 0: + message = "%s %r must be positive integer; " % (text, name) + message += "%r is invalid" % (value,) + raise ValueError(message) + return value diff --git a/python/nn4k/requirements.txt b/python/nn4k/requirements.txt new file mode 100644 index 00000000..e0cdd22e --- /dev/null +++ b/python/nn4k/requirements.txt @@ -0,0 +1,11 @@ +accelerate==0.25.0 +bitsandbytes==0.41.1 +colorama==0.4.6 +cpm_kernels==1.0.11 +scipy==1.10.1 +sentencepiece==0.1.99 +streamlit==1.29.0 +torch==2.1.2 +transformers==4.33.1 +transformers_stream_generator==0.0.4 +xformers==0.0.23.post1 diff --git a/python/nn4k/setup.py b/python/nn4k/setup.py new file mode 100644 index 00000000..bc71110b --- /dev/null +++ b/python/nn4k/setup.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Ant Group CO., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. + +import os + +from setuptools import setup, find_packages + +package_name = "openspg-nn4k" + +# version +cwd = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(cwd, "NN4K_VERSION"), "r") as rf: + version = rf.readline().strip("\n").strip() + +# license +license = "" +with open(os.path.join(cwd, "LICENSE"), "r") as rf: + line = rf.readline() + while line: + line = line.strip() + if line: + license += "# " + line + "\n" + else: + license += "#\n" + line = rf.readline() + +# Generate nn4k.__init__.py +with open(os.path.join(cwd, "nn4k/__init__.py"), "w") as wf: + content = f"""{license} + +__package_name__ = "{package_name}" +__version__ = "{version}" +""" + wf.write(content) + +setup( + name=package_name, + version=version, + description="nn4k", + author="xionghuaidong", + author_email="huaidong.xhd@antgroup.com", + packages=find_packages( + where=".", + exclude=[ + ".*test.py", + "*_test.py", + "*_debug.py", + "*.txt", + "tests", + "tests.*", + "configs", + "configs.*", + "test", + "test.*", + "*.tests", + "*.tests.*", + "*.pyc", + ], + ), + python_requires=">=3.8", + install_requires=[ + r.strip() + for r in open("requirements.txt", "r") + if not r.strip().startswith("#") + ], + include_package_data=True, + package_data={ + "bin": ["*"], + }, +)