Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.inria.corese.core.next.query.api.base.io;
package fr.inria.corese.core.next.query.api.io;

import fr.inria.corese.core.next.data.api.base.io.FileFormat;

Expand All @@ -7,7 +7,7 @@
import java.util.Optional;

/**
* Describes the SPARQL results serialization formats. Defines the static constants representing the standard formats for result representation.
* Describes the standard SPARQL result serialization formats.
*/
public class ResultFormat extends FileFormat {

Expand Down Expand Up @@ -65,10 +65,10 @@ public static Optional<ResultFormat> byName(String name) {
}

/**
* Finds a known RDF format by file extension (case-insensitive).
* Finds a known SPARQL result format by file extension (case-insensitive).
*
* @param extension The file extension (e.g., "ttl").
* @return An Optional containing the matching RdfFormat if found.
* @param extension The file extension (for example, {@code "srx"}).
* @return an optional containing the matching result format
*/
public static Optional<ResultFormat> byExtension(String extension) {
String ext = extension.toLowerCase(Locale.ROOT);
Expand All @@ -79,10 +79,10 @@ public static Optional<ResultFormat> byExtension(String extension) {
}

/**
* Finds a known RDF format by MIME type (case-insensitive).
* Finds a known SPARQL result format by MIME type (case-insensitive).
*
* @param mimeType The MIME type (e.g., "text/turtle").
* @return An Optional containing the matching RdfFormat if found.
* @param mimeType The MIME type (for example, {@code "application/sparql-results+json"}).
* @return an optional containing the matching result format
*/
public static Optional<ResultFormat> byMimeType(String mimeType) {
String mime = mimeType.toLowerCase(Locale.ROOT);
Expand All @@ -93,9 +93,9 @@ public static Optional<ResultFormat> byMimeType(String mimeType) {
}

/**
* Returns a list of all known RDF formats.
* Returns all known SPARQL result formats.
*
* @return An unmodifiable List of all RdfFormat constants.
* @return an unmodifiable list of result formats
*/
public static List<ResultFormat> all() {
return List.of(CSV, TSV, JSON, XML);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package fr.inria.corese.core.next.query.api.io.serializer;

/** Serializes the boolean result of a SPARQL ASK query. */
public interface BooleanResultSerializer extends ResultSerializer {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
import fr.inria.corese.core.next.data.api.io.serializer.Serializer;

public interface ResultSerializer extends Serializer {


}
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
package fr.inria.corese.core.next.query.api.io.serializer;

import fr.inria.corese.core.next.data.api.io.IOOptions;
import fr.inria.corese.core.next.data.api.io.serializer.Serializer;
import fr.inria.corese.core.next.query.api.base.io.ResultFormat;
import fr.inria.corese.core.next.query.api.io.ResultFormat;
import fr.inria.corese.core.next.query.api.result.TupleQueryResult;

/**
* Factory interface for creating {@link ResultSerializer} instances. This interface defines functions to create serializer based on the given result {@link fr.inria.corese.core.kgram.core.Mappings} and the desired {@link ResultFormat}
* Creates serializers for SPARQL tuple and boolean results.
*/
public interface IResultSerializerFactory {
public interface ResultSerializerFactory {

/**
* Creates a serializer for the given {@link TupleQueryResult} results in the given {@link ResultFormat format}
* @param format The {@link ResultFormat} to use for serialization.
* @param results The {@link TupleQueryResult} results to be serialized
* @return a new instance of {@link ResultSerializer} with default configuration.
*/
ResultSerializer createSerializer(ResultFormat format, TupleQueryResult results);
ResultSerializer createTupleSerializer(ResultFormat format, TupleQueryResult results);

/**
* Creates a serializer for the given boolean result in the given {@link ResultFormat format}
*
* @param format The {@link ResultFormat} to use for serialization.
* @param results The boolean result to be serialized
* @param result The boolean result to be serialized
* @return a new instance of {@link ResultSerializer} with default configuration.
*/
Serializer createBooleanSerializer(ResultFormat format, boolean results);
BooleanResultSerializer createBooleanSerializer(ResultFormat format, boolean result);

/**
* Creates a serializer for the given {@link TupleQueryResult} results in the given {@link ResultFormat format}
Expand All @@ -34,15 +33,21 @@ public interface IResultSerializerFactory {
* @param options Options to configure the serialization
* @return a new instance of {@link ResultSerializer} with default configuration.
*/
ResultSerializer createSerializer(ResultFormat format, TupleQueryResult results, IOOptions options);
ResultSerializer createTupleSerializer(
ResultFormat format,
TupleQueryResult results,
IOOptions options);

/**
* Creates a serializer for the given boolean result in the given {@link ResultFormat format}
*
* @param format The {@link ResultFormat} to use for serialization.
* @param results The boolean result to be serialized
* @param result The boolean result to be serialized
* @param options Options to configure the serialization
* @return a new instance of {@link ResultSerializer} with default configuration.
*/
Serializer createBooleanSerializer(ResultFormat format, boolean results, IOOptions options);
BooleanResultSerializer createBooleanSerializer(
ResultFormat format,
boolean result,
IOOptions options);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Contracts for serializing SPARQL tuple and boolean results.
*
* <p>Implementations select a serializer by {@link
* fr.inria.corese.core.next.query.api.io.ResultFormat} and report unsupported
* formats explicitly.</p>
*/
package fr.inria.corese.core.next.query.api.io.serializer;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Query-facing contracts, result types, validation entry points, and I/O
* abstractions.
*
* <p>The final public SPARQL request API is not defined yet. Parser, AST,
* bridge, and execution wiring remain outside this package so they cannot be
* mistaken for that future contract.</p>
*/
package fr.inria.corese.core.next.query.api;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package fr.inria.corese.core.next.query.impl.parser;

/**
* Internal base class that stores the configuration shared by query parsers.
*
* <p>This implementation detail lives beside the concrete parsers; consumers
* pipeline code should use {@link QueryParser}, not extend this class.</p>
*/
abstract class AbstractQueryParser implements QueryParser {

private QueryOptions config;

protected AbstractQueryParser(QueryOptions config) {
this.config = config;
}

@Override
public final void setConfig(QueryOptions options) {
this.config = options;
}

@Override
public final QueryOptions getConfig() {
return config;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.inria.corese.core.next.query;
package fr.inria.corese.core.next.query.impl.parser;

/**
* Marker interface for configuration objects used by {@link QueryParser}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.inria.corese.core.next.query;
package fr.inria.corese.core.next.query.impl.parser;

import fr.inria.corese.core.next.query.impl.sparql.ast.QueryAst;

Expand Down
Loading
Loading