Skip to content

Commit

Permalink
Excluded transitive commercial vaadin deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Aklakan committed Oct 23, 2023
1 parent 996ce44 commit f4cc571
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 60 deletions.
58 changes: 35 additions & 23 deletions facete3-app-parent/facete3-app-vaadin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,32 @@
<dependency>
<groupId>org.vaadin.alejandro</groupId>
<artifactId>pdf-browser</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.xdev-software</groupId>
<artifactId>vaadin-maps-leaflet-flow</artifactId>
<version>1.1.0</version>
<version>3.2.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.xdev-software</groupId>-->
<!-- <artifactId>vaadin-maps-leaflet-flow</artifactId>-->
<!-- <version>1.1.0</version>-->
<!-- </dependency>-->
<!-- https://vaadin.com/directory/component/vstepper -->
<dependency>
<groupId>com.mlottmann.VStepper</groupId>
<artifactId>VStepper</artifactId>
<version>1.0.9</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>com.vaadin</groupId> -->
<!-- <artifactId>leaflet4vaadin</artifactId> -->
<!-- <version>0.3.2</version> -->
<!-- </dependency> -->

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>leaflet4vaadin</artifactId>
<version>0.5.0</version>
<exclusions>
<!-- Should use 'vaadin-core'; 'vaadin' includes commercial components -->
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency> -->
<!-- <groupId>com.fasterxml.jackson.core</groupId> -->
<!-- <artifactId>jackson-core</artifactId> -->
Expand Down Expand Up @@ -258,7 +266,7 @@
<groupId>org.aksw.rmltk</groupId>
<artifactId>r2rml-resource-shacl</artifactId>
</dependency>

<!-- <dependency>-->
<!-- <groupId>org.vaadin.gatanaso</groupId>-->
<!-- <artifactId>multiselect-combo-box-flow</artifactId>-->
Expand Down Expand Up @@ -295,11 +303,13 @@
<artifactId>cglib-nodep</artifactId>
<version>3.3.0</version>
</dependency>
<!--
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<scope>test</scope>
</dependency>
-->
</dependencies>
<build>
<defaultGoal>spring-boot:run</defaultGoal>
Expand Down Expand Up @@ -383,8 +393,9 @@
</plugins>
</build>
</profile>

<!-- Profile for creating a bundle - mainly for debugging and analysis - e.g. which log files are packaged -->

<!-- Profile for creating a bundle - mainly for debugging and analysis -
e.g. which log files are packaged -->
<profile>
<id>bundle</id>
<build>
Expand All @@ -402,17 +413,18 @@
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public DataProviderNodeQuery itemProvider(
// DataProviderNodeQuery dataProvider = new DataProviderNodeQuery(dataSource, conceptSupplier, dataRetriever);

// VaadinShaclGridUtils.fromShacl(null)
return new DataProviderNodeQuery(dataSource, () -> facetedQueryConf.getFacetedQuery().focus().availableValues().baseRelation().toUnaryRelation(), dataRetriever);
return new DataProviderNodeQuery(dataSource, () -> facetedQueryConf.getFacetedQuery().focus().availableValues().baseRelation().toFragment1(), dataRetriever);
}

// @Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import org.aksw.jenax.dataaccess.sparql.connection.common.RDFConnectionBuilder;
import org.aksw.jenax.sparql.fragment.api.Fragment3;
import org.aksw.jenax.sparql.fragment.impl.Fragment3Impl;

import com.google.common.collect.Lists;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.Query;
import org.apache.jena.rdf.model.RDFNode;
Expand All @@ -32,10 +30,14 @@
import org.apache.jena.sparql.engine.binding.BindingBuilder;
import org.apache.jena.sparql.engine.binding.BindingFactory;
import org.apache.jena.sparql.syntax.Template;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.google.common.collect.Lists;

/**
* The config class sets up a connection to the aksw/cord natural language interface (nli)
* service and adds a connection pool mutator that applies query rewriting to introduce a virtual
Expand All @@ -46,7 +48,7 @@
*/
@Configuration
public class ConfigSearchProviderNli {

private static final Logger logger = LoggerFactory.getLogger(ConfigSearchProviderNli.class);


// @Bean
Expand All @@ -67,7 +69,7 @@ public SearchPlugin searchPlugin(NliConfig nliConfig) {


public static SearchSensitiveRDFConnectionTransform createConnectionTransformer(NliConfig nliConfig) {
System.out.println("NLI SERVICE: " + nliConfig.getEndpoint());
logger.info("Natural Language Interface (NLI) Service: " + nliConfig.getEndpoint());
return rdfNodeSpec -> {
Table table = TableFactory.create(Arrays.asList(Vars.s, Vars.o));
for(RDFNode rdfNode : rdfNodeSpec.getCollection()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.aksw.jenax.path.datatype.RDFDatatypePathNode;
import org.aksw.jenax.reprogen.core.JenaPluginUtils;
import org.aksw.jenax.sparql.fragment.api.Fragment1;
import org.aksw.jenax.sparql.fragment.impl.Concept;
import org.aksw.jenax.sparql.fragment.impl.ConceptUtils;
import org.aksw.jenax.sparql.fragment.impl.FragmentImpl;
import org.apache.jena.datatypes.TypeMapper;
Expand Down Expand Up @@ -177,7 +176,7 @@ private void initFacetedQuery(RdfDataSource rdfDataSource) {
}

private void setEmptyBaseConcept() {
Concept emptyConcept = ConceptUtils.createConcept();
Fragment1 emptyConcept = ConceptUtils.createConcept();
facetedQuery = facetedQuery.baseConcept(emptyConcept);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public class FacetedBrowserView

protected Label connectionInfo;

protected MapComponent mapComponent = new MapComponent();

// protected ResourceComponent resourceComponent;

/** The resource browser should eventually supersede the resourceComponent */
Expand Down Expand Up @@ -595,7 +597,13 @@ protected Component getResultsComponent() {
// component.addToPrimary(sparqlGridComponent);


component.addToSecondary(resourceBrowserComponent);

VerticalLayout detailsPanel = new VerticalLayout();
detailsPanel.setSizeFull();
detailsPanel.add(mapComponent);
detailsPanel.add(resourceBrowserComponent);

component.addToSecondary(detailsPanel);
return component;
}

Expand Down Expand Up @@ -677,7 +685,7 @@ public void handleSearchResponse(RDFNodeSpec rdfNodeSpec) {

Fragment1 initialConcept = facete3.getInitialConcept();

Fragment1 baseConcept = initialConcept.joinOn(initialConcept.getVar()).with(searchConcept).toUnaryRelation();
Fragment1 baseConcept = initialConcept.joinOn(initialConcept.getVar()).with(searchConcept).toFragment1();
System.err.println("Base concept: " + baseConcept);
facete3.setBaseConcept(baseConcept);

Expand Down Expand Up @@ -714,7 +722,7 @@ public void deactivateConstraint(HLFacetConstraint<?> constraint) {
// return ids;
// }

private Concept createConcept(List<String> ids) {
private Fragment1 createConcept(List<String> ids) {
List<Node> baseConcepts = new LinkedList<Node>();
for (String id : ids) {
Node baseConcept = NodeFactory.createURI(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
public class ItemComponent extends TabSheet {


/** Unfinished method. Idea is to have the grid dynamically adjust the number of columns on resize. */
public void handleResize() {

Registration unregisterBrowserWindowResizeListener = UI.getCurrent().getPage().addBrowserWindowResizeListener(event -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package org.aksw.facete3.app.vaadin.components;

import com.vaadin.addon.leaflet4vaadin.LeafletMap;
import com.vaadin.addon.leaflet4vaadin.layer.map.options.DefaultMapOptions;
import com.vaadin.addon.leaflet4vaadin.layer.map.options.MapOptions;
import com.vaadin.addon.leaflet4vaadin.types.LatLng;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;

public class MapComponent
extends VerticalLayout
{
public MapComponent() {
setSizeFull();
// // Create the registry which is needed so that components can be reused and their methods invoked
// // Note: You normally don't need to invoke any methods of the registry and just hand it over to the components
// final LComponentManagementRegistry reg = new LDefaultComponentManagementRegistry(this);
//
// // Create and add the MapContainer (which contains the map) to the UI
// final MapContainer mapContainer = new MapContainer(reg);
// mapContainer.setSizeFull();
// this.add(mapContainer);
//
// final LMap map = mapContainer.getlMap();
//
// // Add a (default) TileLayer so that we can see something on the map
// map.addLayer(LTileLayer.createDefaultForOpenStreetMapTileServer(reg));
//
// // Set what part of the world should be shown
// map.setView(new LLatLng(reg, 49.6751, 12.1607), 17);
//
// // Create a new marker
// new LMarker(reg, new LLatLng(reg, 49.6756, 12.1610))
// // Bind a popup which is displayed when clicking the marker
// .bindPopup("XDEV Software")
// // Add it to the map
// .addTo(map);

MapOptions options = new DefaultMapOptions();
options.setCenter(new LatLng(47.070121823, 19.204101562500004));
options.setZoom(7);
LeafletMap leafletMap = new LeafletMap(options);
leafletMap.setBaseUrl("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png");

this.add(leafletMap);
// tabs.newTab("map", "Map", new ManagedComponentSimple(leafletMap));


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public QueryBuilder visit(TravValues<?> node) {
// TODO The alias should affect variable naming

rel = isFwd
? FragmentUtils.createTernaryRelation(s, p, Node.ANY).project(Vars.o).toUnaryRelation()
: FragmentUtils.createTernaryRelation(Node.ANY, p, s).project(Vars.o).toUnaryRelation();
? FragmentUtils.createTernaryRelation(s, p, Node.ANY).project(Vars.o).toFragment1()
: FragmentUtils.createTernaryRelation(Node.ANY, p, s).project(Vars.o).toFragment1();

}

Expand Down Expand Up @@ -80,9 +80,9 @@ public QueryBuilder visit(TravProperty<?> node) {
Fragment1 ur2;

if (isFwd) {
ur2 = FragmentUtils.createTernaryRelation(s, Node.ANY, Node.ANY).project(Vars.p).toUnaryRelation();
ur2 = FragmentUtils.createTernaryRelation(s, Node.ANY, Node.ANY).project(Vars.p).toFragment1();
} else {
ur2 = FragmentUtils.createTernaryRelation(Node.ANY, Node.ANY, s).project(Vars.p).toUnaryRelation();
ur2 = FragmentUtils.createTernaryRelation(Node.ANY, Node.ANY, s).project(Vars.p).toFragment1();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.aksw.jena_sparql_api.data_query.util.KeywordSearchUtils;
import org.aksw.jena_sparql_api.sparql_path.core.algorithm.ConceptPathFinder;
import org.aksw.jenax.dataaccess.sparql.factory.execution.query.QueryExecutionFactoryOverSparqlQueryConnection;
import org.aksw.jenax.sparql.fragment.api.Fragment1;
import org.aksw.jenax.sparql.fragment.impl.Concept;
import org.aksw.jenax.sparql.fragment.impl.ConceptUtils;
import org.aksw.jenax.sparql.fragment.impl.Fragment2Impl;
Expand Down Expand Up @@ -106,7 +107,7 @@ public static void main(String[] args) throws IOException {
System.out.println("equals? " + Objects.equals(a, b));
}

// Concept c = Concept.create("?s a <http://example.org/Person>", "s");
// Fragment1 c = Fragment1.create("?s a <http://example.org/Person>", "s");
// Query q = ConceptAnalyser.checkDatatypes(c);
// System.out.println(q);

Expand Down Expand Up @@ -138,7 +139,7 @@ public static void main(String[] args) throws IOException {

//RDFDataMgr.write(new FileOutputStream("/tmp/wtf.nt"), m, RDFFormat.NTRIPLES_ASCII);

Concept k = KeywordSearchUtils.createConceptBifContains(Fragment2Impl.create(new P_Link(RDFS.label.asNode())), "test");
Fragment1 k = KeywordSearchUtils.createConceptBifContains(Fragment2Impl.create(new P_Link(RDFS.label.asNode())), "test");

//ConceptUtils.createFilterConcept(nodes)
System.out.println("Keyword search: " + k);
Expand All @@ -154,19 +155,19 @@ public static void main(String[] args) throws IOException {
System.out.println("Paths: " + ConceptPathFinder.findPaths(
new QueryExecutionFactoryOverSparqlQueryConnection(conn),
Concept.create("?s a <http://www.example.org/ThingB>", "s"),
//Concept.create("?s <http://www.opengis.net/ont/geosparql#asWKT> ?o ", "s"),
//Fragment1.create("?s <http://www.opengis.net/ont/geosparql#asWKT> ?o ", "s"),
Concept.create("?s <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?x ; <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?y", "s"),
100,
100
100l,
100l
));

System.out.println("Paths: " + ConceptPathFinder.findPaths(
new QueryExecutionFactoryOverSparqlQueryConnection(conn),
Concept.create("?s a <http://www.example.org/ThingA>", "s"),
//Concept.create("?s <http://www.opengis.net/ont/geosparql#asWKT> ?o ", "s"),
//Fragment1.create("?s <http://www.opengis.net/ont/geosparql#asWKT> ?o ", "s"),
Concept.create("?s <http://www.opengis.net/ont/geosparql#geometry> ?y", "s"),
100,
100
100l,
100l
));

}
Expand All @@ -179,7 +180,7 @@ public static void main(String[] args) throws IOException {
SPath rootPath = session.getRoot();//session.getRoot().get(RDF.type.getURI(), false);
SPath typePath = rootPath.get(RDF.type.getURI(), false);

Concept pFilter = ConceptUtils.createFilterConcept(RDF.type.asNode(), RDFS.label.asNode());;
Fragment1 pFilter = ConceptUtils.createFilterConcept(RDF.type.asNode(), RDFS.label.asNode());;

// Map<Node, Range<Long>> facets = new HashMap<>();
// Map<Node, Range<Long>> facets = session.getFacetsAndCounts(rootPath, false, pFilter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static Fragment1 createConceptForDirectlyRelatedItems(Fragment1 baseConce
.joinOn(Vars.o)
.filterRelationFirst(true)
.with(baseConcept)
.toUnaryRelation();
.toFragment1();

return result;
}
Expand Down Expand Up @@ -150,7 +150,7 @@ public static Fragment1 createConceptForDirectlyRelatedItems(Fragment1 baseConce
.joinOn(br.getSourceVar())
.with(availableValues)
.project(br.getSourceVar())
.toUnaryRelation();
.toFragment1();

return result;
}
Expand Down
Loading

0 comments on commit f4cc571

Please sign in to comment.