protected AbstractSQLPPTriplesMap(ImmutableList<TargetAtom> targetAtoms, OBDASQLQuery sqlQuery) { this(targetAtoms, sqlQuery,IDGenerator.getNextUniqueID("MAPID-")); }
protected AbstractSQLPPTriplesMap(ImmutableList<ImmutableFunctionalTerm> targetAtoms, OBDASQLQuery sqlQuery) { this(targetAtoms, sqlQuery,IDGenerator.getNextUniqueID("MAPID-")); }
@Override public OBDAMappingAxiom getRDBMSMappingAxiom(OBDASQLQuery sourceQuery, List<Function> targetQuery) { String id = IDGenerator.getNextUniqueID("MAPID-"); return getRDBMSMappingAxiom(id, sourceQuery, targetQuery); }
private void addMapping() { String id = IDGenerator.getNextUniqueID("MAPID-"); JDialog dialog = new JDialog(); dialog.setTitle("New Mapping"); dialog.setModal(true); NewMappingDialogPanel panel = new NewMappingDialogPanel(apic, dialog, selectedSource); panel.setID(id); dialog.setContentPane(panel); dialog.setSize(600, 500); dialog.setLocationRelativeTo(this); dialog.setVisible(true); }
/** * Beware: immutable class! * <p> * Recommended constructor. * <p> * Changing the Properties object afterwards will not have any effect * on this OntopSQLCoreSettings object. * * @param userProperties */ protected OntopSQLCoreSettingsImpl(Properties userProperties) { super(userProperties); jdbcUrl = getRequiredProperty(OntopSQLCoreSettings.JDBC_URL); jdbcDriver = getProperty(OntopSQLCoreSettings.JDBC_DRIVER); jdbcName = getProperty(OntopSQLCoreSettings.JDBC_NAME) .orElseGet(() -> IDGenerator.getNextUniqueID(DB_PREFIX)); }
/** * Beware: immutable class! * <p> * Recommended constructor. * <p> * Changing the Properties object afterwards will not have any effect * on this OntopSQLCoreSettings object. * * @param userProperties */ protected OntopSQLCoreSettingsImpl(Properties userProperties) { super(userProperties); jdbcUrl = getRequiredProperty(OntopSQLCoreSettings.JDBC_URL); jdbcDriver = getProperty(OntopSQLCoreSettings.JDBC_DRIVER); jdbcName = getProperty(OntopSQLCoreSettings.JDBC_NAME) .orElseGet(() -> IDGenerator.getNextUniqueID(DB_PREFIX)); }
public static Collection<OBDAMappingAxiom> splitMappings(Collection<OBDAMappingAxiom> mappings) { List<OBDAMappingAxiom> newMappings = new LinkedList<>(); OBDADataFactory dfac = OBDADataFactoryImpl.getInstance(); for (OBDAMappingAxiom mapping : mappings) { List<Function> targetQuery = mapping.getTargetQuery(); if (targetQuery.size() == 1) { // For mappings with only one body atom, we do not need to change it newMappings.add(mapping); } else { String id = mapping.getId(); OBDASQLQuery sourceQuery = mapping.getSourceQuery(); for (Function bodyAtom : targetQuery) { String newId = IDGenerator.getNextUniqueID(id + "#"); OBDAMappingAxiom newMapping = dfac.getRDBMSMappingAxiom(newId, sourceQuery, Collections.singletonList(bodyAtom)); newMappings.add(newMapping); } } } return newMappings; } }
public MetaMappingExpander(Collection<SQLPPTriplesMap> mappings) { ImmutableList.Builder<SQLPPTriplesMap> builder1 = ImmutableList.builder(); ImmutableList.Builder<Expansion> builder2 = ImmutableList.builder(); for (SQLPPTriplesMap mapping : mappings) { ImmutableList<ImmutableFunctionalTerm> toBeExpanded = mapping.getTargetAtoms().stream() .filter(atom -> atom.getFunctionSymbol().isTriplePredicate()) .collect(ImmutableCollectors.toList()); if (toBeExpanded.isEmpty()) { builder1.add(mapping); } else { builder2.addAll(toBeExpanded.stream() .map(target -> new Expansion(mapping.getId(), mapping.getSourceQuery(), target)) .iterator()); ImmutableList<ImmutableFunctionalTerm> toBeLeft = mapping.getTargetAtoms().stream() .filter(atom -> !atom.getFunctionSymbol().isTriplePredicate()) .collect(ImmutableCollectors.toList()); if (!toBeLeft.isEmpty()) { // TODO: see how to keep the provenance SQLPPTriplesMap newMapping = new OntopNativeSQLPPTriplesMap( IDGenerator.getNextUniqueID(mapping.getId() + "#"), mapping.getSourceQuery(), toBeLeft); builder1.add(newMapping); } } } nonExpandableMappings = builder1.build(); mappingsToBeExpanded = builder2.build(); }
IDGenerator.getNextUniqueID(m.id + "#"), MAPPING_FACTORY.getSQLQuery(newSourceQuery), ImmutableList.of(newTarget));
IDGenerator.getNextUniqueID(m.id + "#"), MAPPING_FACTORY.getSQLQuery(newSourceQuery), ImmutableList.of(newTarget));
String newId = IDGenerator.getNextUniqueID(id + "#"); OBDAMappingAxiom newMapping = instantiateMapping(newId, targetQuery, bodyAtom, sourceQueryParsed, columnsForTemplate,
List<Function> tquery = axiom.getTargetQuery(); String random_number = IDGenerator.getNextUniqueID(""); random_number = IDGenerator.getNextUniqueID(""); Predicate pred = func.getFunctionSymbol();