On Wed, Jan 29, 2014 at 4:03 PM, Mona Salem <monasalem...@gmail.com> wrote: > Compilation errors: > Exception in thread "main" java.lang.Error: Unresolved compilation problems: > SoftwareProduct cannot be resolved > AnnotationLabel cannot be resolved to a variable > > at TextAnnotation.printAnnotations(TextAnnotation.java:47) > at TextAnnotation.stringToAnnotate(TextAnnotation.java:32) > at Parser.getTitle(Parser.java:291) > at Parser.getAllUrlNames(Parser.java:118) > at Parser.main(Parser.java:723)
The fact that there's a stack trace of this code running makes it seem like this isn't purely a compilation error. Did you compile part of the project separately from others, or something like that? In any case, this doesn't sound like a Jena issue. E.g., AnnotationLabel cannot be resolved to a variable The code you've provided doesn't look right, in the first place. E.g., public class TextAnnotation { static final String REST_URL = "http://data.bioontology.org"; static final ObjectMapper mapper = new ObjectMapper(); // ... private model2 printAnnotations(JsonNode annotations) { for (JsonNode annotation : annotations) { // Get the details for the class that was found in the annotation and print JsonNode classDetails = jsonToNode(get(annotation.get("annotatedClass").get("links").get("self").asText())); //Don't print "preferred Labels", load "prefLabels" into the model // System.out.println("\tprefLabel: " + classDetails.get("prefLabel").asText()); SoftwareProduct.addProperty(AnnotationLabel, classDetails.get("prefLabel").asText()); } } } } ends with too many closing braces. This isn't compilable code. Even if the braces were right, the line SoftwareProduct.addProperty(AnnotationLabel, classDetails.get("prefLabel").asText()); references a variable AnnotationLabel, but it's nowhere to be found. That's why you'd get that particular error message. This isn't particular to Jena at all. If you're not, I'd suggest that you use a Java aware IDE such as Eclipse or NetBeans that can help with these sorts of Java issues. For non-Jena related questions, you should probably try a non-Jena specific mailing list or Q&A site (e.g., StackOverflow). //JT -- Joshua Taylor, http://www.cs.rpi.edu/~tayloj/