Skip to content
Open
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
10 changes: 0 additions & 10 deletions src/main/java/fr/inria/corese/core/sparql/api/IDatatype.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ default IDatatype set(String name, double value) {
return set(DatatypeMap.key(name), DatatypeMap.newInstance(value));
}

default IDatatype set(String name, boolean value) {
return set(DatatypeMap.key(name), DatatypeMap.newInstance(value));
}

/**
* this datatype: iterable of json (or map)
Expand Down Expand Up @@ -362,13 +359,6 @@ default boolean isTripleWithEdge() {

String toSparql(boolean prefix, boolean xsd, boolean skipUndefPrefix, NSManager nsm);

default String trace() {
return String.format("trace: %s code: %s datatype: %s label: %s",
this,
getCode(),
getDatatypeURI(),
getLabel());
}

// Used by XMLLiteral to store a XML DOM
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ String clean(String str) {
return str.replace("\\$", "\\\\$").replace("\\\n", " ");
}

String stringasdt(String str) {
return string(DatatypeMap.newInstance(str));
}

String variable(String str) {
return string(DatatypeMap.newInstance(str));
Expand Down Expand Up @@ -198,9 +195,6 @@ String newLiteral(IDatatype dt) {
}
}

String newInstance(int val) {
return newInteger(val);
}

String newInteger(long val) {
switch ((int) val) {
Expand Down Expand Up @@ -244,9 +238,6 @@ String newInstance(float val) {
return String.format("DatatypeMap.newFloat(%s)", val);
}

String newInstance(long val) {
return String.format("DatatypeMap.newLong(%s)", val);
}

String newInstance(boolean val) {
if (val) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,13 @@ public JavaCompiler() {
init();
}

/**
* target Java class name
*/
public JavaCompiler(String name) {
this();
record(name);
}


@Override
public String toString() {
return sb.toString();
}

/**
* Main function to compile AST functions
*/
public JavaCompiler compile(ASTQuery ast) throws IOException, EngineException {
this.ast = ast;
path(ast);
head.process(getPackage(), name);
compile(ast.getDefine());
compile(ast.getDefineLambda());
trailer();
write();
return this;
}

public JavaCompiler compile(Query q) throws IOException {
this.ast = q.getAST();
path(ast);
head.process(getPackage(), name);
trailer();
write();
return this;
}

public void compile(ASTExtension ext) throws EngineException {
for (Function exp : ext.getFunctionList()) {
Expand Down Expand Up @@ -408,9 +379,6 @@ void map(Term term) {
}
}

String javaName(String name) {
return NSManager.nstrip(name);
}

String mapName(Term term) {
switch (term.oper()) {
Expand Down Expand Up @@ -690,13 +658,6 @@ void defineTermName() {
define(OR, "||");
}

/**
* Java name in let (select where) in function
* sh:path() -> jc:sh_path()
*/
public void setJavaName(String name, String java) {
javaName.put(name, java);
}

public String getJavaName(String name) {
return javaName.get(name);
Expand Down Expand Up @@ -765,10 +726,6 @@ void init() {
defineTermName();
}

boolean skip(String name) {
Boolean b = skip.get(name);
return b != null && b;
}

void path(ASTQuery ast) {
if (ast.hasMetadata(Metadata.Type.PATH)) {
Expand Down Expand Up @@ -863,19 +820,6 @@ StringBuilder append(String str) {
return sb;
}

/**
* @return the function
*/
public Function getFunction() {
return function;
}

/**
* @param function the function to set
*/
public void setFunction(Function function) {
this.function = function;
}

/**
* @return the current
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseBoolean.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ public static String getNormalizedLabel(String label) {
}
}

public static String getNormalizedLabel2(String label) {
if (label.equals(STRUE) || label.equals("1")) {
return STRUE;
} else if (label.equals(SFALSE) || label.equals("0")) {
return SFALSE;
} else {
return null;
}
}

@Override
public boolean equalsWE(IDatatype iod) throws CoreseDatatypeException {
Expand Down
51 changes: 0 additions & 51 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseCalendar.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public class CoreseCalendar extends GregorianCalendar {
CoreseCalendar() {
}

CoreseCalendar(int yy, int mm, int dd) {
super(yy, mm, dd);
}

CoreseCalendar(int yy, int mm, int dd, int hh, int min, int ss) {
super(yy, mm, dd, hh, min, ss);
Expand All @@ -44,68 +41,20 @@ public CoreseCalendar duplicate() {
// return (CoreseCalendar) clone();
}

public CoreseCalendar duplicate(String tz) {
CoreseCalendar cal = duplicate();
cal.setTimeZone(TimeZone.getTimeZone("GMT" + tz));
cal.setDZone(tz);
cal.setZ(cal.getRawOffset() == 0);
return cal;
}

public int getRawOffset() {
return getTimeZone().getRawOffset();
}

boolean sameDate(CoreseCalendar cal) {
return get(YEAR) == cal.get(YEAR) && get(MONTH) == cal.get(MONTH) && get(DAY_OF_MONTH) == cal.get(DAY_OF_MONTH);
}

void setZ(boolean z) {
this.Z = z;
}

boolean getZ() {
return Z;
}

void setDZone(String z) {
this.zone = z;
}

String getDZone() {
return zone;
}

float getSeconds() {
int sec = this.get(Calendar.SECOND);
int mill_sec = this.get(Calendar.MILLISECOND);
return sec + (mill_sec / 1000f);
}

/**
* 1 BC -> -1
* 2 BC -> -2
*/
int theYear() {
int year = get(GregorianCalendar.YEAR);
if (get(GregorianCalendar.ERA) == GregorianCalendar.BC) {
year = -year;
}
return year;
}

/**
* @return the bzone
*/
public boolean isZone() {
return bzone;
}

/**
* @param bzone the bzone to set
*/
public void setZone(boolean bzone) {
this.bzone = bzone;
}

}
7 changes: 0 additions & 7 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseDatatype.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ public static IDatatype getGenericDatatype(String uri) {
return dt;
}

@Deprecated
public static IDatatype create(String valueJType, String label) throws CoreseDatatypeException {
return create(valueJType, null, label, null);
}

/**
* Create a datatype. If it is a not well formed number, create a
Expand Down Expand Up @@ -1242,9 +1238,6 @@ public IDatatype getObjectDatatypeValue() {
return this;
}

public boolean isPath() {
return false;
}

/**
* **************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public CoreseDate(String label) {
}
}

public static CoreseDate today() {
return new CoreseDate(TODAY);
}

@Override
public IDatatype.Datatype getCode() {
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseDecimal.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ public static CoreseDecimal create(BigDecimal value) {
return new CoreseDecimal(value);
}

public static CoreseDecimal create(int value) {
return new CoreseDecimal(value);
}

public static CoreseDecimal create(String value) throws CoreseDatatypeException {
return new CoreseDecimal(value);
}

@Override
public void setValue(double value) {
Expand Down Expand Up @@ -121,10 +114,6 @@ public IDatatype.Datatype getCode() {
return code;
}

@Override
public boolean isDecimal() {
return true;
}

@Override
public BigDecimal decimalValue() {
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseFloat.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,5 @@ public IDatatype.Datatype getCode(){
return code;
}

@Override
public boolean isFloat(){
return true;
}

}
26 changes: 0 additions & 26 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseInteger.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -335,28 +335,6 @@ public IDatatype ge(IDatatype dt) {
// }
//
// @Override
// public IDatatype minus(IDatatype dt) {
// switch (dt.getCode()) {
// case DOUBLE:
// return CoreseDouble.create(doubleValue() - dt.doubleValue());
// case FLOAT:
// return new CoreseFloat(floatValue() - dt.floatValue());
// case DECIMAL:
// return CoreseDecimal.create(doubleValue() - dt.doubleValue());
// case INTEGER:
// try {
// return CoreseInteger.create(Math.subtractExact(longValue(), dt.longValue()));
// } catch (ArithmeticException e) {
// return null;
// }
// }
// return null;
// }

@Override
public IDatatype minus(long val) {
return CoreseInteger.create(longValue() - val);
}

@Override
public String getLowerCaseLabel() {
Expand All @@ -373,8 +351,4 @@ public String getLabel() {
return str;
}

@Override
public boolean isInteger() {
return true;
}
}
3 changes: 0 additions & 3 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseString.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public CoreseString(String value) {

}

public static CoreseString create(String str){
return new CoreseString(str);
}

@Override
public IDatatype getDatatype(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ public class CoreseStringBuilder extends CoreseString {
value = null;
}

public static CoreseStringBuilder create(StringBuilder s){
return new CoreseStringBuilder(s);
}

@Override
public String getLabel(){
Expand All @@ -26,10 +23,6 @@ public StringBuilder getStringBuilder(){
return sb;
}

@Override
public void setStringBuilder(StringBuilder s){
sb = s;
}


}
6 changes: 0 additions & 6 deletions src/main/java/fr/inria/corese/core/sparql/datatype/CoreseStringLiteral.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ public String getLabel() {
}
}

/**
* @return the manager
*/
public IStorage getManager() {
return manager;
}

/**
* @param manager the manager to set
Expand Down
Loading
Loading