Skip to content

Commit 03e192f

Browse files
author
Miel Vander Sande
committed
Prepare code for 0.1.0 (Maven) release
1 parent a742b70 commit 03e192f

File tree

48 files changed

+1101
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1101
-28
lines changed

pom.xml

Lines changed: 108 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,58 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>LDF-Server</groupId>
5-
<artifactId>LDF-Server</artifactId>
6-
<version>0.0.2</version>
4+
<groupId>org.linkeddatafragments</groupId>
5+
<artifactId>ldfserver</artifactId>
6+
<version>0.1.0</version>
77
<packaging>war</packaging>
8-
8+
<name>Linked Data Fragments Server</name>
9+
<url>http://linkeddatafragments.org</url>
10+
<description>
11+
This is a Java implementation of the Linked Data Fragments Server based on Jena.
12+
</description>
13+
<licenses>
14+
<license>
15+
<name>MIT License (MIT)</name>
16+
<url>https://raw.githubusercontent.com/LinkedDataFragments/Server.Java/master/LICENSE.txt</url>
17+
<distribution>repo</distribution>
18+
</license>
19+
</licenses>
20+
<scm>
21+
<connection>https://github.com/LinkedDataFragments/Server.Java.git</connection>
22+
<developerConnection>https://github.com/LinkedDataFragments/Server.Java.git</developerConnection>
23+
<tag>v0.1.0</tag>
24+
<url>https://github.com/LinkedDataFragments/Server.Java</url>
25+
</scm>
26+
<developers>
27+
<developer>
28+
<id>rverborgh</id>
29+
<name>Ruben Verborgh</name>
30+
<email>[email protected]</email>
31+
<url>http://ruben.verborgh.org</url>
32+
<organization>iMinds</organization>
33+
<organizationUrl>http://iminds.be</organizationUrl>
34+
<timezone>Europe/Brussels</timezone>
35+
</developer>
36+
<developer>
37+
<id>mielvds</id>
38+
<name>Miel Vander Sande</name>
39+
<email>[email protected]</email>
40+
<url>http://semweb.mmlab.be</url>
41+
<organization>iMinds</organization>
42+
<organizationUrl>http://iminds.be</organizationUrl>
43+
<timezone>Europe/Brussels</timezone>
44+
</developer>
45+
</developers>
46+
<contributors>
47+
<contributor>
48+
<name>Bart Hanssens</name>
49+
<email>[email protected]</email>
50+
<organization>FEDICT</organization>
51+
</contributor>
52+
<contributor>
53+
<name>Olaf Hartig</name>
54+
</contributor>
55+
</contributors>
956
<properties>
1057
<jettyVersion>9.3.6.v20151106</jettyVersion>
1158
</properties>
@@ -123,6 +170,63 @@
123170
</descriptorRefs>
124171
</configuration>
125172
</plugin>
173+
<plugin>
174+
<groupId>org.apache.maven.plugins</groupId>
175+
<artifactId>maven-source-plugin</artifactId>
176+
<version>2.2.1</version>
177+
<executions>
178+
<execution>
179+
<id>attach-sources</id>
180+
<goals>
181+
<goal>jar-no-fork</goal>
182+
</goals>
183+
</execution>
184+
</executions>
185+
</plugin>
186+
<plugin>
187+
<groupId>org.apache.maven.plugins</groupId>
188+
<artifactId>maven-javadoc-plugin</artifactId>
189+
<version>2.9.1</version>
190+
<executions>
191+
<execution>
192+
<id>attach-javadocs</id>
193+
<goals>
194+
<goal>jar</goal>
195+
</goals>
196+
</execution>
197+
</executions>
198+
</plugin>
199+
<plugin>
200+
<groupId>org.apache.maven.plugins</groupId>
201+
<artifactId>maven-gpg-plugin</artifactId>
202+
<version>1.5</version>
203+
<executions>
204+
<execution>
205+
<id>sign-artifacts</id>
206+
<phase>verify</phase>
207+
<goals>
208+
<goal>sign</goal>
209+
</goals>
210+
</execution>
211+
</executions>
212+
</plugin>
213+
<plugin>
214+
<groupId>org.sonatype.plugins</groupId>
215+
<artifactId>nexus-staging-maven-plugin</artifactId>
216+
<version>1.6.3</version>
217+
<extensions>true</extensions>
218+
<configuration>
219+
<serverId>ossrh</serverId>
220+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
221+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
222+
</configuration>
223+
</plugin>
126224
</plugins>
127225
</build>
226+
<distributionManagement>
227+
<snapshotRepository>
228+
<id>ossrh</id>
229+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
230+
</snapshotRepository>
231+
</distributionManagement>
128232
</project>

src/org/linkeddatafragments/config/ConfigReader.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,21 @@ public Map<String, String> getPrefixes() {
7272
return prefixes;
7373
}
7474

75+
/**
76+
* Gets the base URL
77+
*
78+
* @return the base URL
79+
*/
7580
public String getBaseURL() {
7681
return baseURL;
7782
}
7883

84+
/**
85+
* Loads a certain {@link IDataSourceType} class at runtime
86+
*
87+
* @param className IDataSourceType class
88+
* @return the created IDataSourceType object
89+
*/
7990
protected IDataSourceType initDataSouceType( final String className )
8091
{
8192
final Class<?> c;

src/org/linkeddatafragments/datasource/AbstractRequestProcessor.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ abstract public class AbstractRequestProcessor
1414
@Override
1515
public void close() {}
1616

17+
/**
18+
* Create an {@link ILinkedDataFragment} from {@link ILinkedDataFragmentRequest}
19+
*
20+
* @param request
21+
* @return
22+
* @throws IllegalArgumentException
23+
*/
1724
@Override
1825
final public ILinkedDataFragment createRequestedFragment(
1926
final ILinkedDataFragmentRequest request )
@@ -22,20 +29,45 @@ final public ILinkedDataFragment createRequestedFragment(
2229
return getWorker( request ).createRequestedFragment();
2330
}
2431

32+
/**
33+
* Get the {@link Worker} from {@link ILinkedDataFragmentRequest}
34+
*
35+
* @param request
36+
* @return
37+
* @throws IllegalArgumentException
38+
*/
2539
abstract protected Worker getWorker(
2640
final ILinkedDataFragmentRequest request )
2741
throws IllegalArgumentException;
2842

29-
43+
/**
44+
* Processes {@link ILinkedDataFragmentRequest}s
45+
*
46+
*/
3047
abstract static protected class Worker
3148
{
49+
50+
/**
51+
* The {@link ILinkedDataFragmentRequest} to process
52+
*/
3253
public final ILinkedDataFragmentRequest request;
3354

55+
/**
56+
* Create a Worker
57+
*
58+
* @param request
59+
*/
3460
public Worker( final ILinkedDataFragmentRequest request )
3561
{
3662
this.request = request;
3763
}
3864

65+
/**
66+
* Create the requested {@link ILinkedDataFragment}
67+
*
68+
* @return The ILinkedDataFragment
69+
* @throws IllegalArgumentException
70+
*/
3971
abstract public ILinkedDataFragment createRequestedFragment()
4072
throws IllegalArgumentException;
4173

src/org/linkeddatafragments/datasource/AbstractRequestProcessorForTriplePatterns.java

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
AbstractRequestProcessorForTriplePatterns<CTT,NVT,AVT>
2929
extends AbstractRequestProcessor
3030
{
31+
32+
/**
33+
*
34+
* @param request
35+
* @return
36+
* @throws IllegalArgumentException
37+
*/
3138
@Override
3239
protected final Worker<CTT,NVT,AVT> getWorker(
3340
final ILinkedDataFragmentRequest request )
@@ -43,20 +50,41 @@ protected final Worker<CTT,NVT,AVT> getWorker(
4350
throw new IllegalArgumentException( request.getClass().getName() );
4451
}
4552

53+
/**
54+
*
55+
* @param request
56+
* @return
57+
* @throws IllegalArgumentException
58+
*/
4659
abstract protected Worker<CTT,NVT,AVT> getTPFSpecificWorker(
4760
final ITriplePatternFragmentRequest<CTT,NVT,AVT> request )
4861
throws IllegalArgumentException;
4962

50-
63+
/**
64+
*
65+
* @param <CTT>
66+
* @param <NVT>
67+
* @param <AVT>
68+
*/
5169
abstract static protected class Worker<CTT,NVT,AVT>
5270
extends AbstractRequestProcessor.Worker
5371
{
72+
73+
/**
74+
*
75+
* @param request
76+
*/
5477
public Worker(
5578
final ITriplePatternFragmentRequest<CTT,NVT,AVT> request )
5679
{
5780
super( request );
5881
}
5982

83+
/**
84+
*
85+
* @return
86+
* @throws IllegalArgumentException
87+
*/
6088
@Override
6189
public ILinkedDataFragment createRequestedFragment()
6290
throws IllegalArgumentException
@@ -78,6 +106,16 @@ public ILinkedDataFragment createRequestedFragment()
78106
offset, limit );
79107
}
80108

109+
/**
110+
*
111+
* @param subj
112+
* @param pred
113+
* @param obj
114+
* @param offset
115+
* @param limit
116+
* @return
117+
* @throws IllegalArgumentException
118+
*/
81119
abstract protected ILinkedDataFragment createFragment(
82120
final ITriplePatternElement<CTT,NVT,AVT> subj,
83121
final ITriplePatternElement<CTT,NVT,AVT> pred,
@@ -86,12 +124,23 @@ abstract protected ILinkedDataFragment createFragment(
86124
final long limit )
87125
throws IllegalArgumentException;
88126

127+
/**
128+
*
129+
* @return
130+
*/
89131
protected ITriplePatternFragment createEmptyTriplePatternFragment()
90132
{
91133
return new TriplePatternFragmentImpl( request.getFragmentURL(),
92134
request.getDatasetURL() );
93135
}
94136

137+
/**
138+
*
139+
* @param triples
140+
* @param totalSize
141+
* @param isLastPage
142+
* @return
143+
*/
95144
protected ITriplePatternFragment createTriplePatternFragment(
96145
final Model triples,
97146
final long totalSize,

src/org/linkeddatafragments/datasource/DataSourceBase.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,49 @@
11
package org.linkeddatafragments.datasource;
22

33
/**
4+
* The base class for an {@link IDataSource}
45
*
56
* @author Miel Vander Sande
67
* @author Bart Hanssens
78
*/
89
public abstract class DataSourceBase implements IDataSource {
10+
11+
/**
12+
* Get the datasource title
13+
*/
914
protected String title;
15+
16+
/**
17+
* Get the datasource description
18+
*/
1019
protected String description;
1120

21+
/**
22+
* Create a base for a {@link IDataSource}
23+
*
24+
* @param title the datasource title
25+
* @param description the datasource description
26+
*/
1227
public DataSourceBase(String title, String description) {
1328
this.title = title;
1429
this.description = description;
1530
}
1631

32+
/**
33+
* Get the datasource description
34+
*
35+
* @return
36+
*/
1737
@Override
1838
public String getDescription() {
1939
return this.description;
2040
};
2141

42+
/**
43+
* Get the datasource title
44+
*
45+
* @return
46+
*/
2247
@Override
2348
public String getTitle() {
2449
return this.title;

src/org/linkeddatafragments/datasource/DataSourceTypesRegistry.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,31 @@ public class DataSourceTypesRegistry
1313
private static Map<String, IDataSourceType> registry =
1414
new HashMap<String, IDataSourceType>();
1515

16+
/**
17+
*
18+
* @param typeName
19+
* @return
20+
*/
1621
public static synchronized IDataSourceType getType( final String typeName )
1722
{
1823
return registry.get( typeName );
1924
}
2025

26+
/**
27+
*
28+
* @param typeName
29+
* @return
30+
*/
2131
public static synchronized boolean isRegistered( final String typeName )
2232
{
2333
return registry.containsKey( typeName );
2434
}
2535

36+
/**
37+
*
38+
* @param typeName
39+
* @param type
40+
*/
2641
public static synchronized void register( final String typeName,
2742
final IDataSourceType type )
2843
{

0 commit comments

Comments
 (0)