Write FOAF organization @param w XML writer @param con RDF triple store connection @param iri iRI of the organization @throws XMLStreamException
(XMLStreamWriter w, RepositoryConnection con, Resource iri)
| 938 | * @throws XMLStreamException |
| 939 | */ |
| 940 | private static void writeAgent(XMLStreamWriter w, RepositoryConnection con, Resource iri) |
| 941 | throws XMLStreamException { |
| 942 | w.writeStartElement("foaf:Agent"); |
| 943 | w.writeAttribute("rdf:about", iri.stringValue()); |
| 944 | |
| 945 | if (con.hasStatement(iri, RDF.TYPE, FOAF.PERSON, false)) { |
| 946 | writeType(w, con, iri, FOAF.PERSON); |
| 947 | writeLiterals(w, con, iri, FOAF.NAME, "foaf:name"); |
| 948 | writeLiterals(w, con, iri, FOAF.GIVEN_NAME, "foaf:givenName"); |
| 949 | writeLiterals(w, con, iri, FOAF.FAMILY_NAME, "foaf:familyName"); |
| 950 | writeReferences(w, con, iri, FOAF.WORKPLACE_HOMEPAGE, "foaf:workPlaceHomepage", "foaf:Document", false); |
| 951 | // mainly ORCID for researchers |
| 952 | writeLiterals(w, con, iri, DCTERMS.IDENTIFIER, "dct:identifier"); |
| 953 | writeReferences(w, con, iri, ORG.MEMBER_OF, "org:memberOf"); |
| 954 | } else { |
| 955 | writeType(w, con, iri, FOAF.ORGANIZATION); |
| 956 | writeReferences(w, con, iri, DCTERMS.TYPE, "dct:type"); |
| 957 | writeLiterals(w, con, iri, FOAF.NAME, "foaf:name"); |
| 958 | writeReferences(w, con, iri, FOAF.HOMEPAGE, "foaf:homepage", "foaf:Document", false); |
| 959 | } |
| 960 | |
| 961 | writeReferences(w, con, iri, FOAF.MBOX, "foaf:mbox"); |
| 962 | writeReferences(w, con, iri, FOAF.PHONE, "foaf:phone"); |
| 963 | w.writeEndElement(); |
| 964 | } |
| 965 | |
| 966 | /** |
| 967 | * Write FOAF organizations |
no test coverage detected