private static String makeMessage( Resource root, Property property ) { return "The object " + FmtUtils.stringForResource(root) + " has multiple values for the unique property " + FmtUtils.stringForResource( property ) ; }
public TypeNotUniqueException(Resource type) { super("Multiple types for "+FmtUtils.stringForResource(type)) ; } }
private static String makeMessage( Resource root, Property property ) { return "The object " + FmtUtils.stringForResource(root) + " has no value for the required property " + FmtUtils.stringForResource( property ) ; }
filter += " || (" + predicateVar + " != " + FmtUtils.stringForResource(RDF.type) + " && "; filter += allowedObjectNamespaces.stream() .map(ns -> "(STRSTARTS(STR(" + objectVar + "),'" + ns + "'))") filter += ")\n"; } else if(!allowedClassNamespaces.isEmpty()){ filter += " || " + predicateVar + " != " + FmtUtils.stringForResource(RDF.type) + " || "; filter += "(" + predicateVar + " = " + FmtUtils.stringForResource(RDF.type) + " && "; filter += allowedClassNamespaces.stream() .map(ns -> "(STRSTARTS(STR(" + objectVar + "),'" + ns + "'))") filter += ")\n"; } else if(!allowedObjectNamespaces.isEmpty()){ filter += " || " + predicateVar + " = " + FmtUtils.stringForResource(RDF.type);
public static String stringForResource(Resource r) { return stringForResource(r, newSerializationContext(r.getModel())) ; }
@Override public Object open(Assembler a, Resource cmd, Mode mode) { if ( cmd.hasProperty(AssemblerVocab.pQueryFile) && cmd.hasProperty(AssemblerVocab.pQueryString) ) throw new CommandAssemblerException(cmd, "Both "+FmtUtils.stringForResource(AssemblerVocab.pQueryString)+" and "+FmtUtils.stringForResource(AssemblerVocab.pQueryFile)+" present") ; if ( ! cmd.hasProperty(AssemblerVocab.pQueryFile) && ! cmd.hasProperty(AssemblerVocab.pQueryString) ) throw new CommandAssemblerException(cmd, "No queryString or queryFile present") ; String queryString = GraphUtils.getStringValue(cmd, AssemblerVocab.pQueryString) ; if ( queryString == null ) { String filename = GraphUtils.getStringValue(cmd, AssemblerVocab.pQueryFile) ; queryString = FileManager.get().readWholeFileAsUTF8(filename) ; } // Base?? // Convert to another exception? return QueryFactory.create(queryString) ; } }