Skip to content

Commit

Permalink
Prepare code for 0.1.0 (Maven) release
Browse files Browse the repository at this point in the history
  • Loading branch information
Miel Vander Sande committed Jan 13, 2016
1 parent a742b70 commit 03e192f
Show file tree
Hide file tree
Showing 48 changed files with 1,101 additions and 28 deletions.
112 changes: 108 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,58 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>LDF-Server</groupId>
<artifactId>LDF-Server</artifactId>
<version>0.0.2</version>
<groupId>org.linkeddatafragments</groupId>
<artifactId>ldfserver</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>

<name>Linked Data Fragments Server</name>
<url>http://linkeddatafragments.org</url>
<description>
This is a Java implementation of the Linked Data Fragments Server based on Jena.
</description>
<licenses>
<license>
<name>MIT License (MIT)</name>
<url>https://raw.githubusercontent.com/LinkedDataFragments/Server.Java/master/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>https://github.com/LinkedDataFragments/Server.Java.git</connection>
<developerConnection>https://github.com/LinkedDataFragments/Server.Java.git</developerConnection>
<tag>v0.1.0</tag>
<url>https://github.com/LinkedDataFragments/Server.Java</url>
</scm>
<developers>
<developer>
<id>rverborgh</id>
<name>Ruben Verborgh</name>
<email>[email protected]</email>
<url>http://ruben.verborgh.org</url>
<organization>iMinds</organization>
<organizationUrl>http://iminds.be</organizationUrl>
<timezone>Europe/Brussels</timezone>
</developer>
<developer>
<id>mielvds</id>
<name>Miel Vander Sande</name>
<email>[email protected]</email>
<url>http://semweb.mmlab.be</url>
<organization>iMinds</organization>
<organizationUrl>http://iminds.be</organizationUrl>
<timezone>Europe/Brussels</timezone>
</developer>
</developers>
<contributors>
<contributor>
<name>Bart Hanssens</name>
<email>[email protected]</email>
<organization>FEDICT</organization>
</contributor>
<contributor>
<name>Olaf Hartig</name>
</contributor>
</contributors>
<properties>
<jettyVersion>9.3.6.v20151106</jettyVersion>
</properties>
Expand Down Expand Up @@ -123,6 +170,63 @@
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
11 changes: 11 additions & 0 deletions src/org/linkeddatafragments/config/ConfigReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,21 @@ public Map<String, String> getPrefixes() {
return prefixes;
}

/**
* Gets the base URL
*
* @return the base URL
*/
public String getBaseURL() {
return baseURL;
}

/**
* Loads a certain {@link IDataSourceType} class at runtime
*
* @param className IDataSourceType class
* @return the created IDataSourceType object
*/
protected IDataSourceType initDataSouceType( final String className )
{
final Class<?> c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ abstract public class AbstractRequestProcessor
@Override
public void close() {}

/**
* Create an {@link ILinkedDataFragment} from {@link ILinkedDataFragmentRequest}
*
* @param request
* @return
* @throws IllegalArgumentException
*/
@Override
final public ILinkedDataFragment createRequestedFragment(
final ILinkedDataFragmentRequest request )
Expand All @@ -22,20 +29,45 @@ final public ILinkedDataFragment createRequestedFragment(
return getWorker( request ).createRequestedFragment();
}

/**
* Get the {@link Worker} from {@link ILinkedDataFragmentRequest}
*
* @param request
* @return
* @throws IllegalArgumentException
*/
abstract protected Worker getWorker(
final ILinkedDataFragmentRequest request )
throws IllegalArgumentException;


/**
* Processes {@link ILinkedDataFragmentRequest}s
*
*/
abstract static protected class Worker
{

/**
* The {@link ILinkedDataFragmentRequest} to process
*/
public final ILinkedDataFragmentRequest request;

/**
* Create a Worker
*
* @param request
*/
public Worker( final ILinkedDataFragmentRequest request )
{
this.request = request;
}

/**
* Create the requested {@link ILinkedDataFragment}
*
* @return The ILinkedDataFragment
* @throws IllegalArgumentException
*/
abstract public ILinkedDataFragment createRequestedFragment()
throws IllegalArgumentException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
AbstractRequestProcessorForTriplePatterns<CTT,NVT,AVT>
extends AbstractRequestProcessor
{

/**
*
* @param request
* @return
* @throws IllegalArgumentException
*/
@Override
protected final Worker<CTT,NVT,AVT> getWorker(
final ILinkedDataFragmentRequest request )
Expand All @@ -43,20 +50,41 @@ protected final Worker<CTT,NVT,AVT> getWorker(
throw new IllegalArgumentException( request.getClass().getName() );
}

/**
*
* @param request
* @return
* @throws IllegalArgumentException
*/
abstract protected Worker<CTT,NVT,AVT> getTPFSpecificWorker(
final ITriplePatternFragmentRequest<CTT,NVT,AVT> request )
throws IllegalArgumentException;


/**
*
* @param <CTT>
* @param <NVT>
* @param <AVT>
*/
abstract static protected class Worker<CTT,NVT,AVT>
extends AbstractRequestProcessor.Worker
{

/**
*
* @param request
*/
public Worker(
final ITriplePatternFragmentRequest<CTT,NVT,AVT> request )
{
super( request );
}

/**
*
* @return
* @throws IllegalArgumentException
*/
@Override
public ILinkedDataFragment createRequestedFragment()
throws IllegalArgumentException
Expand All @@ -78,6 +106,16 @@ public ILinkedDataFragment createRequestedFragment()
offset, limit );
}

/**
*
* @param subj
* @param pred
* @param obj
* @param offset
* @param limit
* @return
* @throws IllegalArgumentException
*/
abstract protected ILinkedDataFragment createFragment(
final ITriplePatternElement<CTT,NVT,AVT> subj,
final ITriplePatternElement<CTT,NVT,AVT> pred,
Expand All @@ -86,12 +124,23 @@ abstract protected ILinkedDataFragment createFragment(
final long limit )
throws IllegalArgumentException;

/**
*
* @return
*/
protected ITriplePatternFragment createEmptyTriplePatternFragment()
{
return new TriplePatternFragmentImpl( request.getFragmentURL(),
request.getDatasetURL() );
}

/**
*
* @param triples
* @param totalSize
* @param isLastPage
* @return
*/
protected ITriplePatternFragment createTriplePatternFragment(
final Model triples,
final long totalSize,
Expand Down
25 changes: 25 additions & 0 deletions src/org/linkeddatafragments/datasource/DataSourceBase.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
package org.linkeddatafragments.datasource;

/**
* The base class for an {@link IDataSource}
*
* @author Miel Vander Sande
* @author Bart Hanssens
*/
public abstract class DataSourceBase implements IDataSource {

/**
* Get the datasource title
*/
protected String title;

/**
* Get the datasource description
*/
protected String description;

/**
* Create a base for a {@link IDataSource}
*
* @param title the datasource title
* @param description the datasource description
*/
public DataSourceBase(String title, String description) {
this.title = title;
this.description = description;
}

/**
* Get the datasource description
*
* @return
*/
@Override
public String getDescription() {
return this.description;
};

/**
* Get the datasource title
*
* @return
*/
@Override
public String getTitle() {
return this.title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,31 @@ public class DataSourceTypesRegistry
private static Map<String, IDataSourceType> registry =
new HashMap<String, IDataSourceType>();

/**
*
* @param typeName
* @return
*/
public static synchronized IDataSourceType getType( final String typeName )
{
return registry.get( typeName );
}

/**
*
* @param typeName
* @return
*/
public static synchronized boolean isRegistered( final String typeName )
{
return registry.containsKey( typeName );
}

/**
*
* @param typeName
* @param type
*/
public static synchronized void register( final String typeName,
final IDataSourceType type )
{
Expand Down
Loading

0 comments on commit 03e192f

Please sign in to comment.