mirror of
https://github.com/OpenSPG/openspg.git
synced 2025-11-02 11:04:15 +00:00
Merge remote-tracking branch 'upstream/branch0101' into branch0101
This commit is contained in:
commit
65c13eb86d
@ -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<String, Object> toMap() {
|
||||
Map<String, Object> results = new HashMap<>(2);
|
||||
results.put("spgTypeName", spgTypeName);
|
||||
results.put("properties", properties);
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,8 +51,8 @@ public class OperatorFusing implements EntityFusing {
|
||||
@Override
|
||||
public List<BaseAdvancedRecord> entityFusing(List<BaseAdvancedRecord> records)
|
||||
throws FusingException {
|
||||
List<PythonRecord> pythonRecords =
|
||||
CollectionsUtils.listMap(records, PythonRecordConvertor::toPythonRecord);
|
||||
List<Map<String, Object>> pythonRecords =
|
||||
CollectionsUtils.listMap(records, r -> PythonRecordConvertor.toPythonRecord(r).toMap());
|
||||
InvokeResultWrapper<List<PythonRecord>> invokeResultWrapper = null;
|
||||
try {
|
||||
Map<String, Object> result =
|
||||
|
||||
@ -52,7 +52,7 @@ public class OperatorPredicting implements PropertyPredicting {
|
||||
@Override
|
||||
public List<BaseAdvancedRecord> propertyPredicting(BaseAdvancedRecord record)
|
||||
throws PredictingException {
|
||||
PythonRecord pythonRecord = PythonRecordConvertor.toPythonRecord(record);
|
||||
Map<String, Object> pythonRecord = PythonRecordConvertor.toPythonRecord(record).toMap();
|
||||
InvokeResultWrapper<List<PythonRecord>> invokeResultWrapper = null;
|
||||
try {
|
||||
Map<String, Object> result =
|
||||
|
||||
@ -40,14 +40,6 @@ public abstract class BaseSPGRecord extends BaseRecord implements WithSPGTypeEnu
|
||||
return rawPropertyValueMap;
|
||||
}
|
||||
|
||||
public Map<String, Object> getStdPropertyValueMap() {
|
||||
Map<String, Object> stdPropertyValueMap = new HashMap<>(getProperties().size());
|
||||
for (BasePropertyRecord propertyRecord : getProperties()) {
|
||||
stdPropertyValueMap.put(propertyRecord.getName(), propertyRecord.getValue().getStds());
|
||||
}
|
||||
return stdPropertyValueMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getStdStrPropertyValueMap() {
|
||||
Map<String, String> stdStrPropertyValueMap = new HashMap<>(getProperties().size());
|
||||
for (BasePropertyRecord propertyRecord : getProperties()) {
|
||||
|
||||
@ -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())));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
0.0.1-beta2
|
||||
@ -1,2 +0,0 @@
|
||||
recursive-include knext *
|
||||
recursive-exclude knext/examples *
|
||||
3
python/knext/.gitignore
vendored
Normal file
3
python/knext/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/*.whl
|
||||
/*.egg-info/
|
||||
/build/
|
||||
1
python/knext/KNEXT_VERSION
Normal file
1
python/knext/KNEXT_VERSION
Normal file
@ -0,0 +1 @@
|
||||
0.0.1-beta2
|
||||
@ -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.
|
||||
or implied.
|
||||
2
python/knext/MANIFEST.in
Normal file
2
python/knext/MANIFEST.in
Normal file
@ -0,0 +1,2 @@
|
||||
recursive-include knext *
|
||||
recursive-exclude knext/examples *
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user