Project

General

Profile

« Previous | Next » 

Revision 49001

API for storing on virtuoso

View differences:

modules/dnet-parthenos-publisher/trunk/test/main/java/eu/dnetlib/parthenos/virtuoso/VirtuosoClientTest.java
2 2

  
3 3
import java.io.IOException;
4 4

  
5
import eu.dnetlib.miscutils.functional.xml.SaxonHelper;
6
import net.sf.saxon.s9api.SaxonApiException;
5
import eu.dnetlib.parthenos.publisher.ParthenosPublisherException;
6
import eu.dnetlib.parthenos.publisher.SaxonHelper;
7 7
import org.apache.commons.io.IOUtils;
8 8
import org.apache.commons.logging.Log;
9 9
import org.apache.commons.logging.LogFactory;
......
34 34
	private VirtuosoClient client;
35 35

  
36 36
	@Before
37
	public void prepare() throws SaxonApiException {
37
	public void prepare() throws ParthenosPublisherException {
38 38
		client = new VirtuosoClient(connectionString, testUser, testPwd, new SaxonHelper(), defaultURIBaseURl);
39 39
	}
40 40

  
......
45 45
	}
46 46

  
47 47
	@Test
48
	public void testRecord(){
48
	public void testRecord() throws ParthenosPublisherException {
49 49
		System.out.println(client.feed(getString(recordPath)));
50 50
	}
51 51

  
modules/dnet-parthenos-publisher/trunk/test/main/java/eu/dnetlib/parthenos/publisher/ParthenosPublisherTest.java
1
package eu.dnetlib.parthenos.publisher;
2

  
3
import java.io.IOException;
4

  
5
import eu.dnetlib.parthenos.ParthenosPublisherApplication;
6
import org.apache.commons.io.IOUtils;
7
import org.apache.jena.graph.Triple;
8
import org.apache.jena.util.iterator.ExtendedIterator;
9
import org.junit.Ignore;
10
import org.junit.Test;
11
import org.junit.runner.RunWith;
12
import org.springframework.beans.factory.annotation.Autowired;
13
import org.springframework.beans.factory.annotation.Value;
14
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
15
import org.springframework.boot.test.context.SpringBootTest;
16
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
17
import org.springframework.core.io.ClassPathResource;
18
import org.springframework.test.context.TestPropertySource;
19
import org.springframework.test.context.junit4.SpringRunner;
20
import org.springframework.test.web.servlet.MockMvc;
21
import virtuoso.jena.driver.VirtGraph;
22

  
23
import static org.junit.Assert.assertEquals;
24
import static org.junit.Assert.assertNotEquals;
25
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
26
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
27

  
28
/**
29
 * Created by Alessia Bardi on 29/08/2017.
30
 * Integration test.
31
 *
32
 * @author Alessia Bardi
33
 */
34
@RunWith(SpringRunner.class)
35
@SpringBootTest(
36
		webEnvironment = WebEnvironment.RANDOM_PORT,
37
		classes = ParthenosPublisherApplication.class)
38
@AutoConfigureMockMvc
39
@TestPropertySource(locations = "classpath:application-integrationtest.properties")
40
//Ignore test because ot requires a running virtuoso server
41
@Ignore
42
public class ParthenosPublisherTest {
43

  
44
	private String recordPath = "eu/dnetlib/parthenos/virtuoso/test_record_plain.xml";
45
	@Value("${virtuoso.connectionstring}")
46
	private String connectionString;
47
	@Value("${virtuoso.usr}")
48
	private String testUser ;
49
	@Value("${virtuoso.pwd}")
50
	private String testPwd ;
51
	@Value("${virtuoso.uri.base.default}")
52
	private String defaultURIBaseURl;
53

  
54
	@Autowired
55
	private MockMvc mvc;
56

  
57

  
58
	@Test
59
	public void publishOK() throws Exception {
60
		String graphName = defaultURIBaseURl + "api_________::parthenos___::parthenos::topLevel/parthenos___::8d777f385d3dfec8815d20f7496026dc";
61
		VirtGraph graph = new VirtGraph(graphName, connectionString, testUser, testPwd);
62
		//ensure we have an empty graph
63
		graph.clear();
64
		assertEquals(0, graph.getCount());
65

  
66
		mvc.perform(post("/publish").param("record",  getString(recordPath)).param("serializationMode", "plain"))
67
				.andExpect(status().isOk());
68

  
69
		int count = graph.getCount();
70
		System.out.println(graphName +"has "+count+" triples:");
71
		assertNotEquals(0, graph.getCount());
72
		final ExtendedIterator<Triple> triples = graph.find();
73
		while(triples.hasNext()){
74
			System.out.println(triples.next());
75
		}
76
		//cleanup the virtuoso graph
77
		graph.clear();
78
		assertEquals(0, graph.getCount());
79

  
80
	}
81

  
82
	private String getString(final String classpath) {
83
		try {
84
			final ClassPathResource resource = new ClassPathResource(classpath);
85
			return IOUtils.toString(resource.getInputStream(), "UTF-8");
86
		}catch(IOException e){
87
			return null;
88
		}
89
	}
90

  
91
}
modules/dnet-parthenos-publisher/trunk/test/main/java/eu/dnetlib/parthenos/publisher/ParthenosPublisherControllerTest.java
1
package eu.dnetlib.parthenos.publisher;
2

  
3
import org.junit.Test;
4
import org.junit.runner.RunWith;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
7
import org.springframework.boot.test.mock.mockito.MockBean;
8
import org.springframework.test.context.junit4.SpringRunner;
9
import org.springframework.test.web.servlet.MockMvc;
10

  
11
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
12
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
13

  
14
/**
15
 * Created by Alessia Bardi on 29/08/2017.
16
 *
17
 * @author Alessia Bardi
18
 */
19
@RunWith(SpringRunner.class)
20
@WebMvcTest(ParthenosPublisherController.class)
21
public class ParthenosPublisherControllerTest {
22
	@Autowired
23
	private MockMvc mvc;
24

  
25
	@MockBean
26
	private ParthenosPublisherHelper parthenosPublisherHelper;
27

  
28
	@Test
29
	public void publishOK() throws Exception {
30
		mvc.perform(post("/publish").param("record", "<aTestRecord>value</aTestRecord>").param("parthenosTarget", "VIRTUOSO"))
31
				.andExpect(status().isOk());
32
	}
33

  
34
}
modules/dnet-parthenos-publisher/trunk/test/main/resources/application-integrationtest.properties
1
virtuoso.connectionstring = jdbc:virtuoso://localhost:1111
2
virtuoso.pwd = dba
3
virtuoso.usr = dba
4
virtuoso.uri.base.default =  http://parthenos.test/handle/
modules/dnet-parthenos-publisher/trunk/dnet-parthenos-publisher.iml
21 21
    </content>
22 22
    <orderEntry type="inheritedJdk" />
23 23
    <orderEntry type="sourceFolder" forTests="false" />
24
    <orderEntry type="module" module-name="dnet-core-components" />
25
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.10.RELEASE" level="project" />
26
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.10.RELEASE" level="project" />
27
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.10.RELEASE" level="project" />
28
    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" />
29
    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
30
    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.10.RELEASE" level="project" />
31
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.10.RELEASE" level="project" />
32
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.10.RELEASE" level="project" />
33
    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
34
    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.2" level="project" />
35
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-queryparser:5.5.0" level="project" />
36
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-core:5.5.0" level="project" />
37
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-queries:5.5.0" level="project" />
38
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-sandbox:5.5.0" level="project" />
39
    <orderEntry type="library" name="Maven: org.z3950.zing:cql-java:1.7" level="project" />
40
    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
41
    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
42
    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
43
    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
44
    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.1" level="project" />
45
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
46
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
47
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" />
48
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
49
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
50
    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
51
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" />
52
    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
53
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
54
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" />
55
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" />
56
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
57
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" />
58
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
59
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
60
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" />
61
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" />
62
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" />
63
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" />
64
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
65
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
66 24
    <orderEntry type="library" name="Maven: net.sf.saxon:Saxon-HE:9.5.1-5" level="project" />
67
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
68
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
69
    <orderEntry type="library" name="Maven: com.ximpleware:vtd-xml:2.13.2" level="project" />
70
    <orderEntry type="library" name="Maven: com.mycila:xmltool:3.3" level="project" />
71
    <orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.4.2" level="project" />
72
    <orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
73
    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.3.10.RELEASE" level="project" />
74
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
75 25
    <orderEntry type="library" name="Maven: virtuoso:jena-driver:3.0" level="project" />
76 26
    <orderEntry type="library" name="Maven: openlink:virtuoso-jdbc:4.0" level="project" />
77 27
    <orderEntry type="library" name="Maven: org.apache.jena:jena-arq:3.4.0" level="project" />
......
79 29
    <orderEntry type="library" name="Maven: com.github.jsonld-java:jsonld-java:0.10.0" level="project" />
80 30
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient-cache:4.5.3" level="project" />
81 31
    <orderEntry type="library" name="Maven: org.apache.thrift:libthrift:0.9.3" level="project" />
82
    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.25" level="project" />
83 32
    <orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.4" level="project" />
33
    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
84 34
    <orderEntry type="library" name="Maven: org.apache.jena:jena-tdb:3.4.0" level="project" />
85 35
    <orderEntry type="library" name="Maven: org.apache.jena:jena-rdfconnection:3.4.0" level="project" />
86 36
    <orderEntry type="library" name="Maven: org.apache.jena:jena-cmds:3.4.0" level="project" />
37
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
87 38
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
88 39
    <orderEntry type="library" name="Maven: org.apache.jena:jena-core:3.4.0" level="project" />
89 40
    <orderEntry type="library" name="Maven: org.apache.jena:jena-iri:3.4.0" level="project" />
......
98 49
    <orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
99 50
    <orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
100 51
    <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
52
    <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
101 53
    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
102 54
    <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.6.0" level="project" />
103 55
    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
......
107 59
    <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.4.0" level="project" />
108 60
    <orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
109 61
    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.10.RELEASE" level="project" />
62
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.10.RELEASE" level="project" />
110 63
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.6.RELEASE" level="project" />
111 64
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.6.RELEASE" level="project" />
65
    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.10.RELEASE" level="project" />
66
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.10.RELEASE" level="project" />
67
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.10.RELEASE" level="project" />
68
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.10.RELEASE" level="project" />
112 69
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.6.RELEASE" level="project" />
113 70
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.6.RELEASE" level="project" />
114 71
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.5.6.RELEASE" level="project" />
......
129 86
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
130 87
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.9" level="project" />
131 88
    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.10.RELEASE" level="project" />
89
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.10.RELEASE" level="project" />
90
    <orderEntry type="library" name="Maven: com.google.guava:guava:21.0" level="project" />
91
    <orderEntry type="library" name="Maven: org.apache.solr:solr-solrj:5.5.4" level="project" />
92
    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
93
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
94
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
95
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.3" level="project" />
96
    <orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.6" level="project" />
97
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
98
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
99
    <orderEntry type="library" name="Maven: org.noggit:noggit:0.6" level="project" />
100
    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.25" level="project" />
132 101
  </component>
133 102
</module>
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/msro/workflows/nodes/parthenos/virtuoso/StoreVirtuosoJobNode.java
1
package eu.dnetlib.msro.workflows.nodes.parthenos.virtuoso;
2

  
3
public class StoreVirtuosoJobNode {
4
//		extends SimpleJobNode {
5
//
6
//	private static final Log log = LogFactory.getLog(StoreVirtuosoJobNode.class);
7
//
8
//	private String inputEprParam;
9
//	private String datasourceInterface;
10
//
11
//	@Autowired
12
//	private ResultSetClient resultSetClient;
13
//
14
//	@Autowired
15
//	private VirtuosoClientFactory virtuosoClientFactory;
16
//
17
//	@Override
18
//	protected String execute(final Env env) throws Exception {
19
//
20
//		final ResultSet<?> rsIn = env.getAttribute(this.inputEprParam, ResultSet.class);
21
//		if ((rsIn == null)) { throw new MSROException("InputEprParam (" + this.inputEprParam + ") not found in ENV"); }
22
//		VirtuosoClient virtuosoClient = this.virtuosoClientFactory.getVirtuosoClient();
23
//		long nTriples = virtuosoClient.feed(getResultSetClient().iter(rsIn, String.class), getDatasourceInterface());
24
//		log.info("Stored " + nTriples + " triples in Virtuoso server");
25
//
26
//		env.setAttribute("triples", nTriples);
27
//		return Arc.DEFAULT_ARC;
28
//
29
//	}
30
//
31
//	public String getInputEprParam() {
32
//		return this.inputEprParam;
33
//	}
34
//
35
//	public void setInputEprParam(final String inputEprParam) {
36
//		this.inputEprParam = inputEprParam;
37
//	}
38
//
39
//	public VirtuosoClientFactory getVirtuosoClientFactory() {
40
//		return virtuosoClientFactory;
41
//	}
42
//
43
//	public void setVirtuosoClientFactory(final VirtuosoClientFactory virtuosoClientFactory) {
44
//		this.virtuosoClientFactory = virtuosoClientFactory;
45
//	}
46
//
47
//	public ResultSetClient getResultSetClient() {
48
//		return resultSetClient;
49
//	}
50
//
51
//	public void setResultSetClient(final ResultSetClient resultSetClient) {
52
//		this.resultSetClient = resultSetClient;
53
//	}
54
//
55
//	public String getDatasourceInterface() {
56
//		return datasourceInterface;
57
//	}
58
//
59
//	public void setDatasourceInterface(final String datasourceInterface) {
60
//		this.datasourceInterface = datasourceInterface;
61
//	}
62
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/msro/workflows/nodes/parthenos/virtuoso/DropFromVirtuosoJobNode.java
1
package eu.dnetlib.msro.workflows.nodes.parthenos.virtuoso;
2

  
3
public class DropFromVirtuosoJobNode {
4
//	extends
5
//} SimpleJobNode {
6
//
7
//	private static final Log log = LogFactory.getLog(DropFromVirtuosoJobNode.class);
8
//
9
//	private String datasourceInterface;
10
//
11
//	@Autowired
12
//	private VirtuosoClientFactory virtuosoClientFactory;
13
//
14
//	@Override
15
//	protected String execute(final Env env) throws Exception {
16
//
17
//		VirtuosoClient virtuosoClient = this.virtuosoClientFactory.getVirtuosoClient();
18
//		long nTriples = virtuosoClient.drop(getDatasourceInterface());
19
//		log.info("Deleted " + nTriples + " triples in Virtuoso server");
20
//
21
//		env.setAttribute("triples", nTriples);
22
//		return Arc.DEFAULT_ARC;
23
//
24
//	}
25
//
26
//	public VirtuosoClientFactory getVirtuosoClientFactory() {
27
//		return virtuosoClientFactory;
28
//	}
29
//
30
//	public void setVirtuosoClientFactory(final VirtuosoClientFactory virtuosoClientFactory) {
31
//		this.virtuosoClientFactory = virtuosoClientFactory;
32
//	}
33
//
34
//	public String getDatasourceInterface() {
35
//		return datasourceInterface;
36
//	}
37
//
38
//	public void setDatasourceInterface(final String datasourceInterface) {
39
//		this.datasourceInterface = datasourceInterface;
40
//	}
41
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/ParthenosPublisherApplication.java
1
package eu.dnetlib.parthenos;
2

  
3
/**
4
 * Created by Alessia Bardi on 09/08/2017.
5
 *
6
 * @author Alessia Bardi
7
 */
8

  
9
import org.springframework.boot.SpringApplication;
10
import org.springframework.boot.autoconfigure.SpringBootApplication;
11

  
12
@SpringBootApplication
13
public class ParthenosPublisherApplication {
14

  
15
	public static void main(String[] args) {
16
		SpringApplication.run(ParthenosPublisherApplication.class, args);
17
	}
18

  
19
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/virtuoso/VirtuosoClientFactory.java
1 1
package eu.dnetlib.parthenos.virtuoso;
2 2

  
3
import eu.dnetlib.miscutils.functional.xml.SaxonHelper;
4
import net.sf.saxon.s9api.SaxonApiException;
3
import eu.dnetlib.parthenos.publisher.ParthenosPublisherException;
4
import eu.dnetlib.parthenos.publisher.SaxonHelper;
5 5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.beans.factory.annotation.Value;
7
import org.springframework.stereotype.Component;
6 8

  
7 9
/**
8 10
 * Created by Alessia Bardi on 12/07/2017.
9 11
 *
10 12
 * @author Alessia Bardi
11 13
 */
14
@Component
12 15
public class VirtuosoClientFactory {
13 16

  
17
	@Value("${virtuoso.connectionstring}")
14 18
	private String connectionString;
19
	@Value("${virtuoso.usr}")
15 20
	private String username;
21
	@Value("${virtuoso.pwd}")
16 22
	private String password;
23
	@Value("${virtuoso.uri.base.default}")
17 24
	private String defaultBaseURI;
18 25

  
19 26
	@Autowired
20 27
	private SaxonHelper saxonHelper;
21 28

  
22
	public VirtuosoClient getVirtuosoClient() throws SaxonApiException {
29
	public VirtuosoClient getVirtuosoClient() throws ParthenosPublisherException {
23 30
		return new VirtuosoClient(connectionString, username, password, getSaxonHelper(), defaultBaseURI);
24 31
	}
25 32

  
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/virtuoso/VirtuosoClient.java
1 1
package eu.dnetlib.parthenos.virtuoso;
2 2

  
3
import java.io.IOException;
3 4
import java.util.Map;
4 5

  
5
import com.google.common.collect.Maps;
6
import eu.dnetlib.miscutils.functional.xml.SaxonHelper;
6
import eu.dnetlib.parthenos.publisher.ParthenosPublisherException;
7
import eu.dnetlib.parthenos.publisher.SaxonHelper;
7 8
import net.sf.saxon.s9api.SaxonApiException;
8 9
import net.sf.saxon.s9api.Serializer;
9 10
import net.sf.saxon.s9api.XPathSelector;
......
12 13
import org.apache.commons.logging.Log;
13 14
import org.apache.commons.logging.LogFactory;
14 15
import org.apache.jena.datatypes.xsd.XSDDatatype;
16
import org.apache.jena.ext.com.google.common.collect.Maps;
15 17
import org.apache.jena.rdf.model.*;
16 18
import virtuoso.jena.driver.VirtModel;
17 19

  
......
52 54
			final String password,
53 55
			final SaxonHelper saxonHelper,
54 56
			final String defaultBaseURI)
55
			throws SaxonApiException {
57
			throws ParthenosPublisherException {
56 58
		this.connectionString = connectionString;
57 59
		this.username = username;
58 60
		this.password = password;
59 61
		this.saxonHelper = saxonHelper;
60 62
		this.defaultBaseURI = defaultBaseURI;
61
		prepareXpathSelectors();
63
		try {
64
			prepareXpathSelectors();
65
		}catch(SaxonApiException e){
66
			throw new ParthenosPublisherException(e);
67
		}
62 68
	}
63 69

  
64
	public long feed(final String record) {
65
		if (StringUtils.isBlank(record)) {
66
			log.warn("Got empty record");
67
			return 0;
68
		}
69
		String objIdentifier = extractFromRecord(record, xpathSelectorObjIdentifier);
70
		if (StringUtils.isBlank(objIdentifier)) {
71
			log.warn("Got record with no objIdentifier -- skipping");
72
			return 0;
73
		}
74
		String rdfBlock = extractFromRecord(record, xpathSelectorRDF);
75
		if (StringUtils.isBlank(rdfBlock)) {
76
			log.warn("Missing rdf:RDF in record with objIdentifier " + objIdentifier + " all triples in that named graph will be deleted");
77
		}
78
		String collectionDate = extractFromRecord(record, xpathSelectorCollectionDate);
79
		String transformationDate = extractFromRecord(record, xpathSelectorTransformationDate);
80
		String datasource = extractFromRecord(record, xpathSelectorDatasourceName);
81
		String dsInterface = extractFromRecord(record, xpathSelectorDatasourceApi);
70
	public long feed(final String record) throws ParthenosPublisherException{
71
		try {
72
			if (StringUtils.isBlank(record)) {
73
				log.warn("Got empty record");
74
				return 0;
75
			}
76
			String objIdentifier = extractFromRecord(record, xpathSelectorObjIdentifier);
77
			if (StringUtils.isBlank(objIdentifier)) {
78
				log.warn("Got record with no objIdentifier -- skipping");
79
				return 0;
80
			}
81
			String rdfBlock = extractFromRecord(record, xpathSelectorRDF);
82
			if (StringUtils.isBlank(rdfBlock)) {
83
				log.warn("Missing rdf:RDF in record with objIdentifier " + objIdentifier + " all triples in that named graph will be deleted");
84
			}
85
			String collectionDate = extractFromRecord(record, xpathSelectorCollectionDate);
86
			String transformationDate = extractFromRecord(record, xpathSelectorTransformationDate);
87
			String datasource = extractFromRecord(record, xpathSelectorDatasourceName);
88
			String dsInterface = extractFromRecord(record, xpathSelectorDatasourceApi);
82 89

  
83
		String namedGraph= getRecordDefaultURI(objIdentifier, dsInterface);
84
		Model md = VirtModel.openDatabaseModel(namedGraph, getConnectionString(), getUsername(), getPassword());
85
		log.debug("Opened virtuoso model for graph " + namedGraph);
86
		md.removeAll();
87
		log.debug("Removed all triples from graph " + namedGraph);
88
		md.read(IOUtils.toInputStream(rdfBlock), getDefaultBaseURI());
89
		long size = md.size();
90
		log.info("Graph " + namedGraph + " now has " + size + " triples");
90
			String namedGraph = getRecordDefaultURI(objIdentifier, dsInterface);
91
			Model md = VirtModel.openDatabaseModel(namedGraph, getConnectionString(), getUsername(), getPassword());
92
			log.debug("Opened virtuoso model for graph " + namedGraph);
93
			md.removeAll();
94
			log.debug("Removed all triples from graph " + namedGraph);
95
			md.read(IOUtils.toInputStream(rdfBlock, "UTF-8"), getDefaultBaseURI());
96
			long size = md.size();
97
			log.info("Graph " + namedGraph + " now has " + size + " triples");
91 98

  
92
		long ntriples = feedProvenance(namedGraph, collectionDate, transformationDate, datasource, dsInterface);
93
		log.debug("provenance graph for "+namedGraph+" updated with " + ntriples + " triples");
99
			long ntriples = feedProvenance(namedGraph, collectionDate, transformationDate, datasource, dsInterface);
100
			log.debug("provenance graph for " + namedGraph + " updated with " + ntriples + " triples");
94 101

  
95
		return size;
102
			return size;
103
		}catch(IOException e){
104
			throw new ParthenosPublisherException(e);
105
		}
96 106
	}
97 107

  
98 108
	long feedProvenance(final String namedGraphURI, final String collectionDate, final String transformationDate, final String datasource, final String api) {
......
117 127
		return 3;
118 128
	}
119 129

  
120
	public long feed(final Iterable<String> records) {
130
	public long feed(final Iterable<String> records) throws ParthenosPublisherException {
121 131
		//TODO: can we do it in parallel? if all records have different objIdentifier it is safe, and this must be the case anyway, because the source of records is a D-Net mdstore.
122 132
		long count = 0;
123 133
		for (String r : records) count += this.feed(r);
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/publisher/ParthenosPublisherApplication.java
1
package eu.dnetlib.parthenos.publisher;
2

  
3
/**
4
 * Created by Alessia Bardi on 09/08/2017.
5
 *
6
 * @author Alessia Bardi
7
 */
8

  
9
import org.springframework.boot.SpringApplication;
10
import org.springframework.boot.autoconfigure.SpringBootApplication;
11

  
12
@SpringBootApplication
13
public class ParthenosPublisherApplication {
14

  
15
	public static void main(String[] args) {
16
		SpringApplication.run(ParthenosPublisherApplication.class, args);
17
	}
18

  
19
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/publisher/ParthenosPublisherException.java
1
package eu.dnetlib.parthenos.publisher;
2

  
3
/**
4
 * Created by Alessia Bardi on 29/08/2017.
5
 *
6
 * @author Alessia Bardi
7
 */
8
public class ParthenosPublisherException extends Exception{
9

  
10
	public ParthenosPublisherException() {
11
	}
12

  
13
	public ParthenosPublisherException(final String message) {
14
		super(message);
15
	}
16

  
17
	public ParthenosPublisherException(final String message, final Throwable cause) {
18
		super(message, cause);
19
	}
20

  
21
	public ParthenosPublisherException(final Throwable cause) {
22
		super(cause);
23
	}
24

  
25
	public ParthenosPublisherException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
26
		super(message, cause, enableSuppression, writableStackTrace);
27
	}
28
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/publisher/ParthenosPublisherHelper.java
2 2

  
3 3
import eu.dnetlib.parthenos.virtuoso.VirtuosoClient;
4 4
import eu.dnetlib.parthenos.virtuoso.VirtuosoClientFactory;
5
import net.sf.saxon.s9api.SaxonApiException;
5
import org.apache.commons.logging.Log;
6
import org.apache.commons.logging.LogFactory;
6 7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Component;
7 9

  
8 10
/**
9 11
 * Created by Alessia Bardi on 11/08/2017.
10 12
 *
11 13
 * @author Alessia Bardi
12 14
 */
15
@Component
13 16
public class ParthenosPublisherHelper {
14 17

  
18
	private static final Log log = LogFactory.getLog(ParthenosPublisherHelper.class);
19

  
20
	public enum ParthenosTargets{
21
		ALL, SOLR, VIRTUOSO, JRR, OAI
22
	}
23

  
15 24
	@Autowired
16 25
	private VirtuosoClientFactory virtuosoClientFactory;
17 26

  
18
	public void publish(final String record, final String serializationMode) throws SaxonApiException {
27
	public void publish(final String record, final ParthenosTargets target) throws ParthenosPublisherException {
28
		switch(target){
29
		case ALL:
30
			publishVirtuoso(record);
31
			break;
32
		case VIRTUOSO:
33
			publishVirtuoso(record);
34
			break;
35
			default: throw new ParthenosPublisherException("Target "+target+" not supported yet");
36
		}
37

  
38
	}
39

  
40
	public long unpublish(final String datasourceInterface, final ParthenosTargets target) throws ParthenosPublisherException {
41
		long res = 0;
42
		switch(target){
43
		case ALL:
44
			res = unpublishVirtuoso(datasourceInterface);
45
			break;
46
		case VIRTUOSO:
47
			res = unpublishVirtuoso(datasourceInterface);
48
			break;
49
		default: throw new ParthenosPublisherException("Target "+target+" not supported yet");
50
		}
51
		return res;
52
	}
53

  
54
	private void publishVirtuoso(final String record) throws ParthenosPublisherException {
55
		log.debug("Publishing on virtuoso");
19 56
		VirtuosoClient virtuosoClient = this.virtuosoClientFactory.getVirtuosoClient();
20
			virtuosoClient.feed(record);
57
		virtuosoClient.feed(record);
21 58
	}
22 59

  
60
	private long unpublishVirtuoso(final String datasourceInterface) throws ParthenosPublisherException {
61
		log.debug("Unublishing from virtuoso "+datasourceInterface);
62
		VirtuosoClient virtuosoClient = this.virtuosoClientFactory.getVirtuosoClient();
63
		return virtuosoClient.drop(datasourceInterface);
64
	}
23 65

  
66
//	private void publishSolr(final String record){
67
//		SolrClient solr = new CloudSolrClient.Builder().withSolrUrl("http://localhost:8983/solr").build();
68
//
69
//	}
24 70
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/publisher/ParthenosPublisherController.java
1 1
package eu.dnetlib.parthenos.publisher;
2 2

  
3
import java.util.concurrent.atomic.AtomicLong;
4

  
3
import eu.dnetlib.parthenos.publisher.ParthenosPublisherHelper.ParthenosTargets;
4
import org.apache.commons.lang3.StringUtils;
5
import org.springframework.beans.factory.annotation.Autowired;
5 6
import org.springframework.scheduling.annotation.Async;
6 7
import org.springframework.web.bind.annotation.RequestMapping;
7 8
import org.springframework.web.bind.annotation.RequestMethod;
......
11 12
@RestController
12 13
public class ParthenosPublisherController {
13 14

  
14
	private static final String template = "Hello, %s!";
15
	private final AtomicLong counter = new AtomicLong();
15
	//TODO: to nicely handle arrors, follow https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-error-handling
16 16

  
17
	@RequestMapping("/greeting")
18
	public String greeting(@RequestParam(value="name", defaultValue="World") String name) throws InterruptedException {
19
		Thread.sleep(10000);
20
		return new String(counter.incrementAndGet()+" "+
21
				String.format(template, name));
22
	}
17
	@Autowired
18
	private ParthenosPublisherHelper parthenosPublisherHelper;
23 19

  
24
	@RequestMapping("/greetingAsync")
20
	@RequestMapping(value = "/publish", method = RequestMethod.POST)
25 21
	@Async
26
	public String greetingAsync(@RequestParam(value="name", defaultValue="World") String name) throws InterruptedException {
27
		Thread.sleep(10000);
28
		return new String(counter.incrementAndGet()+" Async "+
29
				String.format(template, name));
22
	public void publish(@RequestParam final String record, @RequestParam(required = false) String parthenosTarget) throws ParthenosPublisherException {
23
		this.parthenosPublisherHelper.publish(record, getTarget(parthenosTarget));
30 24
	}
31 25

  
32
	@RequestMapping(value = "/publish", method = RequestMethod.POST)
26
	@RequestMapping(value = "/unpublish", method = RequestMethod.GET)
33 27
	@Async
34
	public void publish(@RequestParam final String record, @RequestParam final String serializationMode) {
28
	public long unpublish(@RequestParam final String datasourceApi, @RequestParam(required = false) String parthenosTarget) throws ParthenosPublisherException {
29
		return this.parthenosPublisherHelper.unpublish(datasourceApi, getTarget(parthenosTarget));
30
	}
35 31

  
36

  
32
	private ParthenosTargets getTarget(String value){
33
		ParthenosTargets target = ParthenosTargets.ALL;
34
		if (StringUtils.isNotBlank(value)) {
35
			target = ParthenosTargets.valueOf(value);
36
		}
37
		return target;
37 38
	}
38 39

  
39

  
40

  
41 40
}
modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/publisher/SaxonHelper.java
1
package eu.dnetlib.parthenos.publisher;
2

  
3
import java.io.StringReader;
4
import java.util.Map;
5
import java.util.Map.Entry;
6
import javax.xml.transform.sax.SAXSource;
7

  
8
import com.google.common.collect.Maps;
9
import net.sf.saxon.s9api.*;
10
import net.sf.saxon.s9api.Serializer.Property;
11
import org.springframework.stereotype.Component;
12
import org.xml.sax.InputSource;
13

  
14
/**
15
 * Created by alessia on 10/03/17.
16
 */
17
@Component
18
public class SaxonHelper {
19

  
20
	private Processor xmlProcessor = new Processor(false);
21

  
22

  
23
	public Helper help(){
24
		return new Helper();
25
	}
26

  
27
	public class Helper{
28
		private Serializer serializer;
29

  
30
		Helper() {
31
			this.serializer = xmlProcessor.newSerializer();
32
			serializer.setOutputProperty(Property.METHOD, "xml");
33
			serializer.setOutputProperty(Property.INDENT, "yes");
34
		}
35

  
36
		public Helper setSerializerProperty(Property p, String value){
37
			serializer.setOutputProperty(p, value);
38
			return this;
39
		}
40

  
41
		/**
42
		 * Evaluate the given xpath on the given XML source.
43
		 *
44
		 * @param xmlSource  XML source string
45
		 * @param xpath      the xpath to evaluate
46
		 * @param namespaces the map of namespaces to be declared to evaluate the xpath
47
		 * @return an XdmItem resulting from the evaluation of the xpath. Returns null if nothing matches.
48
		 */
49
		public XdmItem evaluateSingle(final String xmlSource, final String xpath, final Map<String, String> namespaces) throws SaxonApiException {
50
			XPathSelector xpathSelector = prepareXPathSelector(xpath, namespaces);
51
			return evaluateSingle(xmlSource, xpathSelector);
52
		}
53

  
54
		/**
55
		 * Applies the given xpath selector on the given XML source.
56
		 *
57
		 * @param xmlSource  XML source string
58
		 * @param xpathSelector    the configured xpath  selector to apply
59
		 * @return an XdmItem resulting from the evaluation of the xpath. Returns null if nothing matches.
60
		 */
61
		public XdmItem evaluateSingle(final String xmlSource, final XPathSelector xpathSelector) throws SaxonApiException {
62
			SAXSource source = new SAXSource(new InputSource(new StringReader(xmlSource)));
63
			DocumentBuilder docBuilder = xmlProcessor.newDocumentBuilder();
64
			XdmNode xdmNode = docBuilder.build(source);
65
			xpathSelector.setContextItem(xdmNode);
66
			return xpathSelector.evaluateSingle();
67
		}
68

  
69
		/**
70
		 * Get an XPathSelector for the given xpath and namespaces.
71
		 * @param xpath the xpath
72
		 * @param namespaces the map of namespaces to be declared to evaluate the xpath
73
		 * @return XPathSelector
74
		 * @throws SaxonApiException
75
		 */
76
		public XPathSelector prepareXPathSelector(final String xpath,final Map<String, String> namespaces) throws SaxonApiException {
77
			XPathCompiler compiler = xmlProcessor.newXPathCompiler();
78
			for (Entry<String, String> ns : namespaces.entrySet()) {
79
				compiler.declareNamespace(ns.getKey(), ns.getValue());
80
			}
81
			XPathExecutable xpathExecutable = compiler.compile(xpath);
82
			XPathSelector xpathSelector = xpathExecutable.load();
83
			return xpathSelector;
84
		}
85

  
86
		/**
87
		 * Get an XPathSelector for the given xpath and namespaces.
88
		 * @param xpath the xpath
89
		 * @param nsPrefix namespace prefix
90
		 * @param ns namespace URI
91
		 * @return XPathSelector
92
		 * @throws SaxonApiException
93
		 */
94
		public XPathSelector prepareXPathSelector(final String xpath,final String nsPrefix, final String ns) throws SaxonApiException {
95
			Map<String, String> map = Maps.newHashMap();
96
			map.put(nsPrefix, ns);
97
			return prepareXPathSelector(xpath, map);
98
		}
99

  
100
		/**
101
		 *  Evaluate the given xpath on the given XML source.
102
		 * @param xmlSource  XML source string
103
		 * @param xpath      the xpath to evaluate
104
		 * @param nsPrefix namespace prefix
105
		 * @param ns namespace URI
106
		 * @return an XdmItem resulting from the evaluation of the xpath. Returns null if nothing matches.
107
		 * @throws SaxonApiException
108
		 *
109
		 */
110
		public XdmItem evaluateSingle(final String xmlSource, final String xpath, final String nsPrefix, final String ns) throws SaxonApiException {
111
			Map<String, String> map = Maps.newHashMap();
112
			map.put(nsPrefix, ns);
113
			return evaluateSingle(xmlSource, xpath, map);
114
		}
115
		/**
116
		 * Evaluate the given xpath on the given XML source.
117
		 *
118
		 * @param xmlSource  XML source string
119
		 * @param xpath      the xpath to evaluate. xpath must evaluate to an xdmNode
120
		 * @param namespaces the map of namespaces to be declared to evaluate the xpath
121
		 * @return the XML serialization as string of the XdmItem resulting from the evaluation of the xpath. Returns null if nothing matches.
122
		 * @throws ClassCastException if xpath is not evaluated to a node.
123
		 */
124
		public String evaluateSingleAsString(final String xmlSource, final String xpath, final Map<String, String> namespaces) throws SaxonApiException {
125
			XdmItem item = evaluateSingle(xmlSource, xpath, namespaces);
126
			if(item != null){
127
				XdmNode node = (XdmNode) item;
128
				return serializer.serializeNodeToString(node);
129
			}
130
			else return null;
131
		}
132

  
133

  
134
		/**
135
		 * Applies the given xpath selector on the given XML source.
136
		 *
137
		 * @param xmlSource  XML source string
138
		 * @param xpathSelector    the configured xpath  selector to apply
139
		 * @return the XML serialization as string of the XdmItem resulting from the evaluation of the xpath. Returns null if nothing matches.
140
		 * @throws ClassCastException if xpath is not evaluated to a node.
141
		 */
142
		public String evaluateSingleAsString(final String xmlSource, final XPathSelector xpathSelector) throws SaxonApiException {
143
			XdmItem item = evaluateSingle(xmlSource, xpathSelector);
144
			if(item != null){
145
				XdmNode node = (XdmNode) item;
146
				return serializer.serializeNodeToString(node);
147
			}
148
			else return null;
149
		}
150

  
151
		/**
152
		 * Evaluate the given xpath on the given XML source.
153
		 *
154
		 * @param xmlSource  XML source string
155
		 * @param xpath      the xpath to evaluate. xpath must evaluate to an xdmNode
156
		 * @param nsPrefix namespace prefix
157
		 * @param ns namespace URI
158
		 * @return the XML serialization as string of the XdmItem resulting from the evaluation of the xpath. Returns null if nothing matches.
159
		 * @throws ClassCastException if xpath is not evaluated to a node.
160
		 */
161
		public String evaluateSingleAsString(final String xmlSource, final String xpath, final String nsPrefix, final String ns) throws SaxonApiException {
162
			Map<String, String> map = Maps.newHashMap();
163
			map.put(nsPrefix, ns);
164
			return evaluateSingleAsString(xmlSource, xpath, map);
165
		}
166

  
167

  
168
	}
169

  
170

  
171

  
172

  
173

  
174
}
modules/dnet-parthenos-publisher/trunk/src/main/resources/eu/dnetlib/parthenos/virtuoso/applicationContext-virtuoso.properties
1
virtuoso.connectionstring = jdbc:virtuoso://localhost:1111
2
virtuoso.pwd = dba
3
virtuoso.usr = dba
4
virtuoso.uri.base.default =  http://parthenos.d4science.org/handle/
modules/dnet-parthenos-publisher/trunk/src/main/resources/eu/dnetlib/parthenos/virtuoso/applicationContext-virtuoso.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
       xmlns:p="http://www.springframework.org/schema/p"
4
       xmlns="http://www.springframework.org/schema/beans"
5
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
6

  
7
	<bean id="virtuosoClientFactory" class="eu.dnetlib.parthenos.virtuoso.VirtuosoClientFactory"
8
		p:connectionString="${virtuoso.connectionstring}" p:password="${virtuoso.pwd}" p:username="${virtuoso.usr}"
9
		p:defaultBaseURI="${virtuoso.uri.base.default"/>
10

  
11
</beans>
modules/dnet-parthenos-publisher/trunk/src/main/resources/eu/dnetlib/parthenos/applicationContext-msro-parthenos-nodes.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
       xmlns:p="http://www.springframework.org/schema/p"
4
       xmlns="http://www.springframework.org/schema/beans"
5
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
6

  
7
	<bean id="wfNodeStoreVirtuoso"
8
	      class="eu.dnetlib.msro.workflows.nodes.parthenos.virtuoso.StoreVirtuosoJobNode"
9
	      scope="prototype"/>
10

  
11
	<bean id="wfNodeDropFromVirtuoso"
12
	      class="eu.dnetlib.msro.workflows.nodes.parthenos.virtuoso.DropFromVirtuosoJobNode"
13
	      scope="prototype"/>
14
</beans>
modules/dnet-parthenos-publisher/trunk/src/main/resources/application.properties
1
server.contextPath                  =   /parthenos
2

  
3
virtuoso.connectionstring = jdbc:virtuoso://localhost:1111
4
virtuoso.pwd = dba
5
virtuoso.usr = dba
6
virtuoso.uri.base.default =  http://parthenos.d4science.org/handle/
modules/dnet-parthenos-publisher/trunk/pom.xml
59 59
	</repositories>
60 60

  
61 61
	<dependencies>
62
		<!-- Needed for SaxonHelper class -->
62
		<!--&lt;!&ndash; Needed for SaxonHelper class &ndash;&gt;-->
63
		<!--<dependency>-->
64
			<!--<groupId>eu.dnetlib</groupId>-->
65
			<!--<artifactId>dnet-core-components</artifactId>-->
66
			<!--<version>2.0.0-SAXONHE-SNAPSHOT</version>-->
67
		<!--</dependency>-->
63 68
		<dependency>
64
			<groupId>eu.dnetlib</groupId>
65
			<artifactId>dnet-core-components</artifactId>
66
			<version>2.0.0-SAXONHE-SNAPSHOT</version>
69
			<groupId>net.sf.saxon</groupId>
70
			<artifactId>Saxon-HE</artifactId>
71
			<version>9.5.1-5</version>
67 72
		</dependency>
68 73
		<dependency>
69 74
			<groupId>virtuoso</groupId>
......
113 118
			<artifactId>spring-boot-starter-web</artifactId>
114 119
			<version>RELEASE</version>
115 120
		</dependency>
121
		<dependency>
122
			<groupId>com.google.guava</groupId>
123
			<artifactId>guava</artifactId>
124
			<version>21.0</version>
125
		</dependency>
126
		<dependency>
127
			<groupId>org.apache.solr</groupId>
128
			<artifactId>solr-solrj</artifactId>
129
			<version>[5.0.0,6.0.0)</version>
130
		</dependency>
116 131
	</dependencies>
117 132

  
118 133
	<build>

Also available in: Unified diff