The following document contains the results of PMD's CPD 4.2.2.
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 933 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 1148 |
}
}
/*
* Check if a specified Molecule's parameter or a term is used in the actual
* axiom as Instance, Relation or Datatype, or whether it is a Variable
*/
private boolean check(Object o, boolean concept, boolean instance,
boolean relation, boolean datatype, boolean variable) {
if (o instanceof Molecule) {
if (concept && checkConcepts(((Molecule) o).getLeftParameter())) {
error = "Concept";
return true;
}
if (instance && checkInstances(((Molecule) o).getLeftParameter())) {
error = "Instance";
return true;
}
else if (relation && checkRelations(((Molecule) o).getLeftParameter())) {
error = "Relation";
return true;
}
else if (datatype && checkDatatypes(((Molecule) o).getLeftParameter())) {
error = "Datatype";
return true;
}
else if (variable && (((Molecule) o).getLeftParameter() instanceof Variable)) {
error = "Variable";
return true;
}
}
else if (o instanceof Term) {
if (concept && checkConcepts(o)) {
error = "Concept";
}
if (instance && checkInstances(o)) {
error = "Instance";
return true;
}
else if (relation && checkRelations(o)) {
error = "Relation";
return true;
}
else if (datatype && checkDatatypes(o)) {
error = "Datatype";
return true;
}
else if (variable && (o instanceof Variable)) {
error = "Variable";
return true;
}
}
return false;
}
/*
* Checks if a specified Term is contained in the concepts vector
*/
private boolean checkConcepts(Object o) {
return validator.getIdConcepts().contains(o);
}
/*
* Checks if a specified Term is contained in the instances vector
*/
private boolean checkInstances(Object o) {
return validator.getIdInstances().contains(o);
}
/*
* Checks if a specified Term is contained in the relations vector
*/
private boolean checkRelations(Object o) {
return validator.getIdRelations().contains(o);
}
/*
* Checks if a specified Term is contained in the abstract relations vector
*/
private boolean checkAbstractRelations(Object o) {
return validator.getIdAbstractRelations().contains(o);
}
/*
* Checks if a specified Term is contained in the concrete relations vector
*/
private boolean checkConcreteRelations(Object o) {
return validator.getIdConcreteRelations().contains(o);
}
/*
* Checks if a specified Term is contained in the datatypes vector
*/
private boolean checkDatatypes(Object o) {
return ConstantTransformer.getInstance().isDataType(o.toString());
}
public Set getMolecules() {
| |
| File | Line |
|---|---|
| com/ontotext/wsmo4j/serializer/xml/WsmlXmlSerializer.java | 90 |
| org/deri/wsmo4j/io/serializer/rdf/WsmlRdfSerializer.java | 146 |
catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* Serialize array of top entities to XML
* @param item Entities to serialize
* @param target Output
* @param options Ignored
*/
public void serialize(TopEntity[] item, Writer target, Map options) throws IOException {
serialize(item, target);
}
/**
* Serialize array of top entities to XML
* @param item Entities to serialize
* @param target Output
*/
public void serialize(TopEntity[] item, final StringBuffer target) {
Writer myWriter = new Writer() {
public void write(String arg0) throws IOException {
target.append(arg0);
}
public void write(String arg0, int arg1, int arg2) throws IOException {
target.append(arg0.toCharArray(), arg1, arg2);
}
public void write(int arg0) throws IOException {
if (arg0 <= 255) {
target.append((char) arg0);
}
else {
byte[] bytes = new byte[] {(byte) (arg0 & 0x00FF), (byte) (arg0 & 0xFF00)};
target.append(new String(bytes));
}
}
public void write(char[] arg0) throws IOException {
target.append(arg0);
}
public void write(char[] arg0, int arg1, int arg2) throws IOException {
target.append(arg0, arg1, arg2);
}
public void flush() throws IOException {
return;
}
public void close() throws IOException {
return;
}
};
try {
serialize(item, myWriter);
}
catch (IOException e) {
return;
}
}
/**
* Serialize array of top entities to XML
* @param item Entities to serialize
* @param target Output
* @param options Ignored
*/
public void serialize(TopEntity[] item, StringBuffer target, Map options) {
serialize(item, target);
}
}
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 293 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 261 |
isValidBMolecule(expr);
}
else {
// the identifier must be an Instance
if (check(expr.getLeftParameter(), true, false, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe range identifier must be an Instance, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
// the arguments of a value definition attribute must be DataValues or Instances
if (check(expr.getRightParameter(), true, false, true, false, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":\nThe arguments " +
"must be DataValues or Instances, " +
"not " + error + "\n" + leSerializer.serialize(expr));
}
else {
// if the argument is a DataValue, the attribute's name must be a relation with concrete range
if (checkDatatypes(expr.getRightParameter())) {
if (!checkConcreteRelations(expr.getAttribute())) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ": \nThe name " +
"must be a relation with concrete range " +
"(because the argument is a DataValue)\n" + leSerializer.serialize(expr));
}
}
// if the argument is an instance, the attribute's name must be a relation with abstract range
else if (checkInstances(expr.getRightParameter())) {
if (!checkAbstractRelations(expr.getAttribute())) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ": \nThe name " +
"must be a relation with abstract range " +
"(because the argument is an instance)\n" + leSerializer.serialize(expr));
}
}
}
}
}
/**
* @see org.deri.wsmo4j.validator.WsmlFullExpressionValidator#visitCompoundMolecule(org.omwg.logicalexpression.CompoundMolecule)
*/
public void visitCompoundMolecule(CompoundMolecule expr) {
// System.out.println("\nCompoundMolecule in now: " + expr.toString());
Iterator i = expr.listOperands().iterator();
while(i.hasNext()){
((Molecule)i.next()).accept(this);
}
}
/**
* @see org.deri.wsmo4j.validator.WsmlFullExpressionValidator#visitMemberShipMolecule(org.omwg.logicalexpression.MembershipMolecule)
*/
public void visitMemberShipMolecule(MembershipMolecule expr) {
| |
| File | Line |
|---|---|
| com/ontotext/wsmo4j/parser/owl/WSMLFromOWL.java | 937 |
| com/ontotext/wsmo4j/parser/owl/WSMLFromOWL.java | 1001 |
String query = "select R from "+
" {<"+uriStr+">} serql:directSubClassOf {R}, {R} rdf:type {<"+OWLConstants.OWL_Restriction+">}"
;
QueryResultsTable result = _repository.performTableQuery(QueryLanguage.SERQL, query);
for (int i = 0; i < result.getRowCount(); i++) {
Resource element = (Resource)result.getValue(i, 0);
IRI asId = _factory.createIRI(uriStr + (++axiom_counter));
Axiom ax = _factory.createAxiom(asId);
theOntology.addAxiom(ax);
ax.addNFPValue(_factory.createIRI(Constants.DC_relation), id);
String foo = (String)allRestrictions.get(element);
do {
int pos = foo.indexOf("|class|");
if (pos < 0)
break;
foo = foo.substring(0, pos)+ xForm(uriStr)+foo.substring(pos + "|class|".length());
} while (true);
ax.addDefinition(_leFactory.createLogicalExpression(foo, theOntology));
concept.addNFPValue(_factory.createIRI(Constants.DC_relation), asId);
}
}catch (Exception e) {
e.printStackTrace();
}
}
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 202 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 218 |
}
else {
// the identifier must be a Concept
if (check(expr.getLeftParameter(), false, true, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe range identifier must be a Concept, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
// the arguments of an infering attribute must be datatypes or concepts
if (check(expr.getRightParameter(), false, true, true, false, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ": \nThe arguments " +
"must be Datatypes or Concepts, " +
"not " + error + "\n" + leSerializer.serialize(expr));
}
else {
// if the argument is a datatype, the attribute's name must be a relation with concrete range
if (checkDatatypes(expr.getRightParameter())) {
if (!checkConcreteRelations(expr.getAttribute())) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ": \nThe name " +
"must be a relation with concrete range " +
"(because the argument is a datatype)\n" + leSerializer.serialize(expr));
}
}
// if the argument is a concept, the attribute's name must be a relation with abstract range
else if (checkConcepts(expr.getRightParameter())) {
if (!checkAbstractRelations(expr.getAttribute())) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ": \nThe name " +
"must be a relation with abstract range " +
"(because the argument is a concept)\n" + leSerializer.serialize(expr));
}
}
}
}
}
/**
* @see org.deri.wsmo4j.validator.WsmlFullExpressionValidator#visitAttributeValueMolecule(org.omwg.logicalexpression.AttributeValueMolecule)
*/
public void visitAttributeValueMolecule(AttributeValueMolecule expr) {
| |
| File | Line |
|---|---|
| com/ontotext/wsmo4j/parser/wsml/ParserImpl.java | 150 |
| org/deri/wsmo4j/io/parser/wsml/LogExprParserImpl.java | 165 |
e.setErrorLine(t.getLine() - 1);
e.setErrorPos(t.getPos());
e.setFoundToken(t.getText());
try {
e.setExpectedToken(pe.getMessage().split("expecting: ")[1].trim());
}
catch (IndexOutOfBoundsException iobE) {
//if error message does not follow usual pattern
e.setExpectedToken(pe.getMessage());
}
throw e;
}
catch (org.wsmo.wsml.compiler.lexer.LexerException le) {
ParserException e = new ParserException(ParserException.NOT_VALID_PARSETREE, le);
try {
e.setErrorLine(Integer.parseInt(le.getMessage().split(",")[0].split("\\[")[1]));
}
catch (NumberFormatException nfE) {
//could not find line so leave default
}
try {
e.setErrorPos(Integer.parseInt(le.getMessage().split(",")[1].split("\\]")[0]));
}
catch (NumberFormatException nfE) {
//could not find pos so leave default
}
throw e;
}
catch (IOException ioe) {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 160 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 185 |
}
else {
// the identifier must be a Concept
if (check(expr.getLeftParameter(), false, true, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe range identifier must be a Concept, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
// the arguments must be datatypes
if (check(expr.getRightParameter(), true, true, true, false, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe arguments must be " +
"Datatypes, not " + error + "\n" + leSerializer.serialize(expr));
}
// the attribute's name must be a Relation with concrete range
if ((check(expr.getAttribute(), true, true, false, true, true))
|| (!checkConcreteRelations(expr.getAttribute()))){
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe name must be a Relation with concrete range, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
}
}
/**
* @see org.deri.wsmo4j.validator.WsmlFullExpressionValidator#visitAttributeInferenceMolecule(org.omwg.logicalexpression.AttributeInferenceMolecule)
*/
public void visitAttributeInferenceMolecule(AttributeInferenceMolecule expr) {
| |
| File | Line |
|---|---|
| com/ontotext/wsmo4j/parser/owl/WSMLFromOWL.java | 905 |
| com/ontotext/wsmo4j/parser/owl/WSMLFromOWL.java | 979 |
} else if (allRestrictions.containsKey(element)){
IRI asId = _factory.createIRI(uriStr + (++axiom_counter));
Axiom ax = _factory.createAxiom(asId);
theOntology.addAxiom(ax);
ax.addNFPValue(_factory.createIRI(Constants.DC_relation), id);
String foo = (String)allRestrictions.get(element);
do {
int pos = foo.indexOf("|class|");
if (pos < 0)
break;
foo = foo.substring(0, pos)+ xForm(uriStr)+foo.substring(pos + "|class|".length());
} while (true);
try {
ax.addDefinition(_leFactory.createLogicalExpression(foo, theOntology));
} catch (ParserException pe) {
throw new InvalidModelException(pe);
}
concept.addNFPValue(_factory.createIRI(Constants.DC_relation), asId);
}
}
try {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/io/parser/rdf/RDFParserImpl.java | 126 |
| org/deri/wsmo4j/io/parser/xml/LogExprParserImpl.java | 46 |
Object o = map.get(Factory.WSMO_FACTORY);
if (o == null || ! (o instanceof WsmoFactory)) {
o = Factory.createWsmoFactory(new HashMap <String, Object> ());
}
factory = (WsmoFactory)o;
assert (factory != null);
o = map.get(Factory.LE_FACTORY);
if (o == null || ! (o instanceof LogicalExpressionFactory)) {
o = Factory.createLogicalExpressionFactory(new HashMap <String, Object> ());
}
leFactory = (LogicalExpressionFactory)o;
assert (leFactory != null);
o = map.get(Factory.DATA_FACTORY);
if (o == null || ! (o instanceof DataFactory)) {
o = Factory.createDataFactory(new HashMap <String, Object> ());
}
dataFactory = (DataFactory)o;
assert (dataFactory != null);
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 1129 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 1419 |
List <Term> l = listMap.get(v1);
if (l.contains(v2)) {
return true;
}
else {
connected.add(v1);
Iterator it = l.iterator();
while (it.hasNext()) {
Variable v = (Variable) it.next();
for (int i=0; i<connected.size(); i++) {
if (v.equals(connected.get(i))) {
used = true;
}
}
if (!used) {
found = checkGraphConnected(v, v2);
}
if (found) {
return true;
}
used = false;
}
return false;
}
}
/*
* Checks if a given graph contains a cycle.
*/
private boolean checkGraphAcyclic(Variable from, Variable v, List checkList) {
if ((numberOfMolecules + 1) == variables.size()) {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/factory/DataFactoryImpl.java | 292 |
| org/deri/wsmo4j/factory/DataFactoryImpl.java | 318 |
if (cal.isSet(Calendar.ZONE_OFFSET)) {
int zoneOffSetHour = cal.getTimeZone().getRawOffset() / 1000 / 60;
int zoneOffSetMinute = cal.get(Calendar.ZONE_OFFSET) / 1000 % 60;
return new SimpleDataValue[] {
createWsmlInteger(new BigInteger("" + cal.get(Calendar.YEAR))),
createWsmlInteger(new BigInteger("" + (cal.get(Calendar.MONTH) + 1))),
createWsmlInteger(new BigInteger("" + cal.get(Calendar.DAY_OF_MONTH))),
createWsmlInteger(new BigInteger("" + zoneOffSetHour)),
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 414 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 380 |
}
else {
error = "";
// the identifier must be a Concept
if (check(expr.getLeftParameter(), false, true, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe identifier must be a Concept, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
// the arguments must be Concepts
if (check(expr.getRightParameter(), false, true, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe arguments must be Concepts, " +
"not " + error + "\n" + leSerializer.serialize(expr));
}
}
}
/**
* Checks if a Negation is valid to wsml-dl.
*
* @see org.deri.wsmo4j.validator.WsmlFullExpressionValidator#visitNegation(org.omwg.logicalexpression.Negation)
*/
public void visitNegation(Negation expr) {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 149 |
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 191 |
+ leSerializer.serialize(expr);
// An AttributeInferenceMolecule is no valid right-hand side formula
if (rhs) {
if (errorFlag) {
addError(expr, ValidationError.AX_RHS_ERR + error);
}
}
else if (lhs) {
if (errorFlag) {
addError(expr, ValidationError.AX_LHS_ERR + error);
}
}
else {
// the identifier must be a Concept
if (check(expr.getLeftParameter(), false, true, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe range identifier must be a Concept, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
// the arguments of an infering attribute must be datatypes or concepts
if (check(expr.getRightParameter(), false, true, true, false, true)) {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 378 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 343 |
}
}
else {
// the identifier must be an Instance
if (check(expr.getLeftParameter(), true, false, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe identifier must be an Instance, " +
"not a " + error + "\n" + leSerializer.serialize(expr));
}
// the arguments must be Concepts
if (check(expr.getRightParameter(), false, true, true, true, true)) {
addError(expr, ValidationError.AX_ATOMIC_ERR + ":"
+ "\nThe arguments must be Concepts, " +
"not " + error + "\n" + leSerializer.serialize(expr));
}
}
}
/**
* @see org.deri.wsmo4j.validator.WsmlFullExpressionValidator#visitSubConceptMolecule(org.omwg.logicalexpression.SubConceptMolecule)
*/
public void visitSubConceptMolecule(SubConceptMolecule expr) {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/AttributeErrorImpl.java | 39 |
| org/deri/wsmo4j/validator/LogicalExpressionErrorImpl.java | 44 |
}
/**
* Formats the String representation of the ValidationError.
*
* @see java.lang.Object#toString()
*/
public String toString() {
String id = "<Identifier>";
//short id if possible:
if (getEntity() != null) {
id = getEntity().getIdentifier().toString();
if (getEntity().getIdentifier()instanceof IRI) {
id = ((IRI)getEntity().getIdentifier()).getLocalName();
}
}
//short for variant if possible
String shortVariant = getViolatesVariant();
if (getViolatesVariant().lastIndexOf('/') != -1) {
shortVariant =getViolatesVariant().substring(getViolatesVariant().lastIndexOf('/') + 1);
}
return id + "\n" + getReason() +
| |
| File | Line |
|---|---|
| com/ontotext/wsmo4j/parser/owl/WSMLFromOWL.java | 906 |
| com/ontotext/wsmo4j/parser/owl/WSMLFromOWL.java | 943 |
IRI asId = _factory.createIRI(uriStr + (++axiom_counter));
Axiom ax = _factory.createAxiom(asId);
theOntology.addAxiom(ax);
ax.addNFPValue(_factory.createIRI(Constants.DC_relation), id);
String foo = (String)allRestrictions.get(element);
do {
int pos = foo.indexOf("|class|");
if (pos < 0)
break;
foo = foo.substring(0, pos)+ xForm(uriStr)+foo.substring(pos + "|class|".length());
} while (true);
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/logicalexpression/util/OntologyUtil.java | 102 |
| org/deri/wsmo4j/logicalexpression/util/OntologyUtil.java | 137 |
checkLogicalExpressions(c.getOntology());
if (!attributeMap.isEmpty()) {
Set entrySet = attributeMap.entrySet();
Iterator itSet = entrySet.iterator();
while (itSet.hasNext()) {
Entry entry = (Entry) itSet.next();
Term conId = (Term) entry.getKey();
Term attId = (Term) entry.getValue();
if (conId.equals(c)) {
if (!attributeList.contains(attId)) {
attributeList.add(attId);
}
}
}
}
return attributeList;
}
/**
* Collecting all instances from a given ontology.
*
* @param o Ontology to be checked for contained instances
* @return List of terms, identifying all instances from the ontology
* @throws InvalidModelException
* @throws SynchronisationException
*/
public static List getInstances(Ontology o)
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/factory/DataFactoryImpl.java | 296 |
| org/deri/wsmo4j/factory/DataFactoryImpl.java | 307 |
return new SimpleDataValue[] {
createWsmlInteger(new BigInteger("" + cal.get(Calendar.YEAR))),
createWsmlInteger(new BigInteger("" + (cal.get(Calendar.MONTH) + 1))),
createWsmlInteger(new BigInteger("" + cal.get(Calendar.DAY_OF_MONTH))),
createWsmlInteger(new BigInteger("" + cal.get(Calendar.HOUR_OF_DAY))),
createWsmlInteger(new BigInteger("" + cal.get(Calendar.MINUTE))),
createWsmlDecimal(new BigDecimal(seconds))};
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 1108 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 1398 |
List <Term> l = itMol.next();
if (l.get(0).equals(v1)) {
v = (Variable) l.get(1);
list.add(v);
}
else if (l.get(1).equals(v1)) {
v = (Variable) l.get(0);
list.add(v);
}
}
listMap.put(v1, list);
}
}
/*
* Checks if variable v1 is connected to variable v2.
*/
private boolean checkGraphConnected(Variable v1, Variable v2) {
boolean found = false;
boolean used = false;
List <Term> l = listMap.get(v1);
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreValidator.java | 94 |
| org/deri/wsmo4j/validator/WsmlRuleValidator.java | 68 |
le.accept(ruleExprVal);
}
}
/**
* Checks if a concept is valid to wsml-rule.
*
* @see org.deri.wsmo4j.validator.WsmlFullValidator#visitConcept(org.omwg.ontology.Concept)
*/
protected void visitConcept(Concept concept) {
super.visitConcept(concept);
}
/**
* Checks if an instance is valid to wsml-rule.
*
* @see org.deri.wsmo4j.validator.WsmlFullValidator#visitInstance(org.omwg.ontology.Instance)
*/
protected void visitInstance(Instance instance) {
super.visitInstance(instance);
}
/**
* Checks if a relation is valid to wsml-rule.
*
* @see org.deri.wsmo4j.validator.WsmlFullValidator#visitRelation(org.omwg.ontology.Relation)
*/
protected void visitRelation(Relation relation) {
super.visitRelation(relation);
}
/**
* Checks if a relation instance is valid to wsml-rule.
*
* @throws InvalidModelException
* @throws SynchronisationException
* @see org.deri.wsmo4j.validator.WsmlFullValidator#visitRelationInstance(org.omwg.ontology.RelationInstance)
*/
protected void visitRelationInstance(RelationInstance relationInstance)
throws SynchronisationException, InvalidModelException {
super.visitRelationInstance(relationInstance);
}
public boolean isValid(LogicalExpression logExpr, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages) {
super.isValid(logExpr, errorMessages, warningMessages);
errors = errorMessages;
warnings = warningMessages;
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/io/serializer/rdf/NodeValue.java | 96 |
| org/deri/wsmo4j/io/serializer/rdf/NodeValue.java | 112 |
ensure00(val.getArgumentValue((byte)1).getValue().toString()) + ":" +
ensure00(val.getArgumentValue((byte)2).getValue().toString());
switch(val.getArity()) {
case 4:
return ret + ensure00(serializeTimezone(
val.getArgumentValue((byte)3).getValue(),null));
case 5:
return ret + ensure00(serializeTimezone(
val.getArgumentValue((byte)3).getValue(),
val.getArgumentValue((byte)4).getValue()));
}
return ret;
}
private static String serializeDateTime(ComplexDataValue val) {
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/validator/WsmlCoreExpressionValidator.java | 1071 |
| org/deri/wsmo4j/validator/WsmlDLExpressionValidator.java | 1359 |
connected.clear();
valid = checkGraphConnected(v1, v);
if (!valid) {
addError(expr, ValidationError.AX_GRAPH_ERR + ":\nGraph is " +
"not connected:\n" + leSerializer.serialize(expr));
return false;
}
}
// check if the given graph is acyclic
List <Variable> checkList = new Vector <Variable> ();
checkList.add(v1);
valid = checkGraphAcyclic(v1, v1, checkList);
if (valid) {
return true;
}
else {
addError(expr, ValidationError.AX_GRAPH_ERR + ":\nGraph contains " +
"cycle:\n" + leSerializer.serialize(expr));
return false;
}
}
| |
| File | Line |
|---|---|
| org/deri/wsmo4j/io/parser/rdf/RDFExprParser.java | 974 |
| org/deri/wsmo4j/io/parser/rdf/RDFExprParser.java | 1068 |
throws SynchronisationException, InvalidModelException {
IRI iri = null;
// check for spaces in names
if (name.indexOf(" ") != -1) {
name = name.replaceAll(" ", "%20");
addWarning("No spaces allowed in identifiers! - Spaces in " +
"one or more instances identifiers " +
"have been replaced by '%20'!", statement);
}
// check for anonymous ids
try {
iri = factory.createIRI(name);
} catch (IllegalArgumentException e) {
if(name.startsWith("node")) {
iri = factory.createIRI("blank:" + name);
} else {
addWarning("Anonymous identifiers problem - One or more " +
"anonymous instances have not been added to " +
"the WSMO object model!", statement);
return null;
}
}
if (ontology.findInstance(iri) == null) {
| |
| File | Line |
|---|---|
| com/ontotext/wsmo4j/parser/wsml/ParserImpl.java | 50 |
| org/deri/wsmo4j/io/parser/rdf/RDFParserImpl.java | 125 |
public RDFParserImpl(Map map) {
Object o = map.get(Factory.WSMO_FACTORY);
if (o == null || !(o instanceof WsmoFactory)) {
o = Factory.createWsmoFactory(new HashMap <String, Object> ());
}
factory = (WsmoFactory) o;
assert (factory != null);
o = map.get(Factory.LE_FACTORY);
if (o == null || !(o instanceof LogicalExpressionFactory)) {
o = Factory.createLogicalExpressionFactory(new HashMap <String, Object> ());
}
| |