//// it is not the document so a cited source
public static PerspectiveJsonObject getPerspectiveObjectForEvent(TrigTripleData trigTripleData, String mentionUri, String meta) {
        PerspectiveJsonObject perspectiveJsonObject = new PerspectiveJsonObject();
        String author = "";
        String cite = "";
       // System.out.println("Start");
        ArrayList<String> perspectives = new ArrayList<String>();
        if (trigTripleData.tripleMapGrasp.containsKey(mentionUri)) {
            ArrayList<Statement> perspectiveTriples = trigTripleData.tripleMapGrasp.get(mentionUri);
           // System.out.println("perspectiveTriples.size() = " + perspectiveTriples.size());
            for (int i = 0; i < perspectiveTriples.size(); i++) {
                Statement statement = perspectiveTriples.get(i);
                String subject = statement.getSubject().getURI();
                String predicate = statement.getPredicate().getURI();
                String object = statement.getObject().toString();
                if (predicate.endsWith("#hasAttribution")) {
                    if (trigTripleData.tripleMapGrasp.containsKey(object)) {
                        ArrayList<Statement> perspectiveValues = trigTripleData.tripleMapGrasp.get(object);
                        for (int j = 0; j < perspectiveValues.size(); j++) {
                            Statement statement1 = perspectiveValues.get(j);
                            //System.out.println("statement1.toString() = " + statement1.toString());
                           // System.out.println("statement1.getObject().toString() = " + statement1.getObject().toString());
                            //ttp://www.w3.org/ns/prov#wasAttributedTo,
                            if (statement1.getPredicate().getURI().endsWith("#wasAttributedTo")) {
                                if (trigTripleData.tripleMapGrasp.containsKey(statement1.getObject().toString())) {
                                    //// this means the source has properties so it is likely to be the document with an author
                                    ArrayList<Statement> provStatements = trigTripleData.tripleMapGrasp.get(statement1.getObject().toString());
                                    for (int k = 0; k < provStatements.size(); k++) {
                                        Statement statement2 = provStatements.get(k);
                                        author = statement2.getObject().toString();
                                        int idx = author.lastIndexOf("/");
                                        if (idx > -1) {
                                            author = author.substring(idx + 1);
                                        }
                                     //   System.out.println("author source = " + author);
                                    }
                                } else {
                                    //// it is not the document so a cited source
                                    cite = statement1.getObject().toString();
                                    int idx = cite.lastIndexOf("/");
                                    if (idx > -1) {
                                        cite = cite.substring(idx + 1);
                                    }
/*                                  THIS DOES NOT WORK: PRONOUNS, RECEPTIONIST, ETC...
                                    //// There can be source documents without meta data.
                                    //// In that case, there are no triples for in tripleMapGrasp with this subject but it is still a document
                                    //// The next hack checks for upper case characters in the URI
                                    //// If they are present, we assume it is somebody otherwise we assume it is a document and we assign it to the meta string
                                    if (cite.toLowerCase().equals(cite)) {
                                        //// no uppercase characters
                                        cite = meta;
                                    }
*/
                                  //  System.out.println("quote source = " + cite);
                                }
                            } else if (statement1.getPredicate().getURI().endsWith("#value")) {
                                String perspective = "";
                                String str = statement1.getObject().toString();
                                //   System.out.println("str = " + str);
                                int idx = str.lastIndexOf("#");
                                if (idx > -1) {
                                    perspective = str.substring(idx + 1);
                                } else {
                                    idx = str.lastIndexOf("/");
                                    if (idx > -1) {
                                        perspective = str.substring(idx + 1);
                                    } else {
                                        perspective = str;
                                    }
                                }
                                ArrayList<String> myPerspectives = PerspectiveJsonObject.normalizePerspectiveValue(perspective);
                                for (int k = 0; k < myPerspectives.size(); k++) {
                                    String myPerspective = myPerspectives.get(k);
                                    if (!perspectives.contains(myPerspective)) {
                                      //  System.out.println("myPerspective = " + myPerspective);
                                        perspectives.add(myPerspective);
                                    }
                                }
                            } else {
                               //     System.out.println("statement1.getPredicate().getURI() = " + statement1.getPredicate().getURI());
                            }
                        }
                    }
                }
            }
            if (perspectives.size() > 0) {
              //  System.out.println("final author = " + author);
                perspectiveJsonObject = new PerspectiveJsonObject(perspectives, author, cite, "", "", "", mentionUri, null);
            }
        }
        return perspectiveJsonObject;
    }
}
} else {
//// it is not the document so a cited source
cite = statement1.getObject().toString();
int idx = cite.lastIndexOf("/");
for (int k = 0; k < provStatements.size(); k++) {
Statement statement2 = provStatements.get(k);
author = statement2.getObject().toString();
int idx = author.lastIndexOf("/");
if (idx > -1) {
author = author.substring(idx + 1);
}
// System.out.println("author source = " + author);
}
} else {
//// it is not the document so a cited source
cite = statement1.getObject().toString();
int idx = cite.lastIndexOf("/");
if (idx > -1) {
cite = cite.substring(idx + 1);
}
/* THIS DOES NOT WORK: PRONOUNS, RECEPTIONIST, ETC...
//// There can be source documents without meta data.
//// In that case, there are no triples for in tripleMapGrasp with this subject but it is still a document
//// The next hack checks for upper case characters in the URI
//// If they are present, we assume it is somebody otherwise we assume it is a document and we assign it to the meta string
ArrayList<Statement> perspectiveValues = trigTripleData.tripleMapGrasp.get(object);
for (int j = 0; j < perspectiveValues.size(); j++) {
Statement statement1 = perspectiveValues.get(j);
//System.out.println("statement1.toString() = " + statement1.toString());
// System.out.println("statement1.getObject().toString() = " + statement1.getObject().toString());
//ttp://www.w3.org/ns/prov#wasAttributedTo,
if (statement1.getPredicate().getURI().endsWith("#wasAttributedTo")) {
if (trigTripleData.tripleMapGrasp.containsKey(statement1.getObject().toString())) {
//// this means the source has properties so it is likely to be the document with an author
ArrayList<Statement> provStatements = trigTripleData.tripleMapGrasp.get(statement1.getObject().toString());
for (int k = 0; k < provStatements.size(); k++) {
Statement statement2 = provStatements.get(k);
author = statement2.getObject().toString();
int idx = author.lastIndexOf("/");
if (idx > -1) {
author = author.substring(idx + 1);
}
// System.out.println("author source = " + author);
}
} else {
//// it is not the document so a cited source
cite = statement1.getObject().toString();
int idx = cite.lastIndexOf("/");
if (idx > -1) {
cite = cite.substring(idx + 1);
}
/* THIS DOES NOT WORK: PRONOUNS, RECEPTIONIST, ETC...
//// There can be source documents without meta data.
//// In that case, there are no triples for in tripleMapGrasp with this subject but it is still a document
//// The next hack checks for upper case characters in the URI
//// If they are present, we assume it is somebody otherwise we assume it is a document and we assign it to the meta string
if (cite.toLowerCase().equals(cite)) {
//// no uppercase characters
cite = meta;
}
*/
// System.out.println("quote source = " + cite);
}
} else if (statement1.getPredicate().getURI().endsWith("#value")) {
String perspective = "";
String str = statement1.getObject().toString();