1394 HashMap<String, String> hm =
new HashMap();
1397 JSONObject oldObject = (JSONObject)
new JSONParser().parse(json_old);
1398 JSONObject newObject = (JSONObject)
new JSONParser().parse(json_new);
1400 String oldDescription = (String) oldObject.get(
"description");
1401 String newDescription = (String) newObject.get(
"description");
1402 JSONArray oldTranslations = (JSONArray) oldObject.get(
"translations");
1403 JSONArray newTranslations = (JSONArray) newObject.get(
"translations");
1404 JSONArray oldBroader = (JSONArray) oldObject.get(
"broader");
1405 JSONArray newBroader = (JSONArray) newObject.get(
"broader");
1406 JSONArray oldNarrower = (JSONArray) oldObject.get(
"narrower");
1407 JSONArray newNarrower = (JSONArray) newObject.get(
"narrower");
1408 JSONArray oldRelated = (JSONArray) oldObject.get(
"related");
1409 JSONArray newRelated = (JSONArray) newObject.get(
"related");
1410 JSONArray oldBroadMatch = (JSONArray) oldObject.get(
"broadMatch");
1411 JSONArray newBroadMatch = (JSONArray) newObject.get(
"broadMatch");
1412 JSONArray oldNarrowMatch = (JSONArray) oldObject.get(
"narrowMatch");
1413 JSONArray newNarrowMatch = (JSONArray) newObject.get(
"narrowMatch");
1414 JSONArray oldRelatedMatch = (JSONArray) oldObject.get(
"relatedMatch");
1415 JSONArray newRelatedMatch = (JSONArray) newObject.get(
"relatedMatch");
1416 JSONArray oldCloseMatch = (JSONArray) oldObject.get(
"closeMatch");
1417 JSONArray newCloseMatch = (JSONArray) newObject.get(
"closeMatch");
1418 JSONArray oldExactMatch = (JSONArray) oldObject.get(
"exactMatch");
1419 JSONArray newExactMatch = (JSONArray) newObject.get(
"exactMatch");
1420 JSONArray oldSeeAlso = (JSONArray) oldObject.get(
"seeAlso");
1421 JSONArray newSeeAlso = (JSONArray) newObject.get(
"seeAlso");
1425 if (oldDescription ==
null && newDescription !=
null) {
1426 hm.put(
"objectType",
"description");
1427 hm.put(
"action",
"add");
1428 hm.put(
"valueBefore",
"");
1429 hm.put(
"valueAfter", newDescription);
1430 }
else if (oldDescription !=
null && newDescription ==
null) {
1431 hm.put(
"objectType",
"description");
1432 hm.put(
"action",
"delete");
1433 hm.put(
"valueBefore", oldDescription);
1434 hm.put(
"valueAfter",
"");
1435 }
else if (oldDescription != newDescription) {
1436 hm.put(
"objectType",
"description");
1437 hm.put(
"action",
"modify");
1438 hm.put(
"valueBefore", oldDescription);
1439 hm.put(
"valueAfter", newDescription);
1443 if (oldTranslations !=
null && newTranslations !=
null) {
1444 if (!oldTranslations.equals(newTranslations)) {
1445 if (oldTranslations.size() == newTranslations.size()) {
1446 hm.put(
"objectType",
"translation");
1447 hm.put(
"action",
"modify");
1448 JSONArray oldTranslationsTmp = oldTranslations;
1449 JSONArray newTranslationsTmp = newTranslations;
1450 oldTranslationsTmp.removeAll(newTranslationsTmp);
1451 for (Object item : oldTranslationsTmp) {
1452 JSONObject tmp = (JSONObject) item;
1453 hm.put(
"valueBefore", tmp.get(
"value") +
" (" + tmp.get(
"lang") +
")");
1455 for (Object item : newTranslationsTmp) {
1456 JSONObject tmp = (JSONObject) item;
1457 hm.put(
"valueAfter", tmp.get(
"value") +
" (" + tmp.get(
"lang") +
")");
1459 }
else if (oldTranslations.size() > newTranslations.size()) {
1460 hm.put(
"objectType",
"translation");
1461 hm.put(
"action",
"delete");
1462 for (Object item : oldTranslations) {
1463 if (!newTranslations.contains(item)) {
1464 JSONObject tmp = (JSONObject) item;
1465 hm.put(
"valueBefore", tmp.get(
"value") +
" (" + tmp.get(
"lang") +
")");
1466 hm.put(
"valueAfter",
"");
1471 hm.put(
"objectType",
"translation");
1472 hm.put(
"action",
"add");
1473 for (Object item : newTranslations) {
1474 if (!oldTranslations.contains(item)) {
1475 JSONObject tmp = (JSONObject) item;
1476 hm.put(
"valueBefore",
"");
1477 hm.put(
"valueAfter", tmp.get(
"value") +
" (" + tmp.get(
"lang") +
")");
1483 }
else if (oldTranslations ==
null && newTranslations !=
null) {
1484 for (Object item : newTranslations) {
1485 JSONObject tmp = (JSONObject) item;
1486 hm.put(
"objectType",
"translation");
1487 hm.put(
"action",
"add");
1488 hm.put(
"valueBefore",
"");
1489 hm.put(
"valueAfter", tmp.get(
"value") +
" (" + tmp.get(
"lang") +
")");
1491 }
else if (oldTranslations !=
null && newTranslations ==
null) {
1492 for (Object item : oldTranslations) {
1493 JSONObject tmp = (JSONObject) item;
1494 hm.put(
"objectType",
"translation");
1495 hm.put(
"action",
"delete");
1496 hm.put(
"valueBefore", tmp.get(
"value") +
" (" + tmp.get(
"lang") +
")");
1497 hm.put(
"valueAfter",
"");
1502 if (oldBroader !=
null && newBroader !=
null) {
1503 if (!oldBroader.equals(newBroader)) {
1504 if (oldBroader.size() == newBroader.size()) {
1505 hm.put(
"objectType",
"broader");
1506 hm.put(
"action",
"modify");
1507 JSONArray oldBroaderTmp = oldBroader;
1508 JSONArray newBroaderTmp = newBroader;
1509 oldBroaderTmp.removeAll(newBroaderTmp);
1510 for (Object item : oldBroader) {
1511 String tmp = (String) item;
1512 hm.put(
"valueBefore", tmp);
1513 hm.put(
"bidirectional", tmp);
1514 hm.put(
"bidirectional-del", tmp);
1516 for (Object item : newBroader) {
1517 String tmp = (String) item;
1518 hm.put(
"valueAfter", tmp);
1519 hm.put(
"bidirectional-add", tmp);
1521 }
else if (oldBroader.size() > newBroader.size()) {
1522 hm.put(
"objectType",
"broader");
1523 hm.put(
"action",
"delete");
1524 for (Object item : oldBroader) {
1525 if (!newBroader.contains(item)) {
1526 String tmp = (String) item;
1527 hm.put(
"valueBefore", tmp);
1528 hm.put(
"valueAfter",
"");
1529 hm.put(
"bidirectional", tmp);
1534 hm.put(
"objectType",
"broader");
1535 hm.put(
"action",
"add");
1536 for (Object item : newBroader) {
1537 if (!oldBroader.contains(item)) {
1538 String tmp = (String) item;
1539 hm.put(
"valueBefore",
"");
1540 hm.put(
"valueAfter", tmp);
1541 hm.put(
"bidirectional", tmp);
1547 }
else if (oldBroader ==
null && newBroader !=
null) {
1548 for (Object item : newBroader) {
1549 String tmp = (String) item;
1550 hm.put(
"objectType",
"broader");
1551 hm.put(
"action",
"add");
1552 hm.put(
"valueBefore",
"");
1553 hm.put(
"valueAfter", tmp);
1554 hm.put(
"bidirectional", tmp);
1556 }
else if (oldBroader !=
null && newBroader ==
null) {
1557 for (Object item : oldBroader) {
1558 String tmp = (String) item;
1559 hm.put(
"objectType",
"broader");
1560 hm.put(
"action",
"delete");
1561 hm.put(
"valueBefore", tmp);
1562 hm.put(
"valueAfter",
"");
1563 hm.put(
"bidirectional", tmp);
1568 if (oldNarrower !=
null && newNarrower !=
null) {
1569 if (!oldNarrower.equals(newNarrower)) {
1570 if (oldNarrower.size() == newNarrower.size()) {
1571 hm.put(
"objectType",
"narrower");
1572 hm.put(
"action",
"modify");
1573 JSONArray oldNarrowerTmp = oldNarrower;
1574 JSONArray newNarrowerTmp = newNarrower;
1575 oldNarrowerTmp.removeAll(newNarrowerTmp);
1576 for (Object item : oldNarrower) {
1577 String tmp = (String) item;
1578 hm.put(
"valueBefore", tmp);
1579 hm.put(
"bidirectional", tmp);
1580 hm.put(
"bidirectional-del", tmp);
1582 for (Object item : newNarrower) {
1583 String tmp = (String) item;
1584 hm.put(
"valueAfter", tmp);
1585 hm.put(
"bidirectional-add", tmp);
1587 }
else if (oldNarrower.size() > newNarrower.size()) {
1588 hm.put(
"objectType",
"narrower");
1589 hm.put(
"action",
"delete");
1590 for (Object item : oldNarrower) {
1591 if (!newNarrower.contains(item)) {
1592 String tmp = (String) item;
1593 hm.put(
"valueBefore", tmp);
1594 hm.put(
"valueAfter",
"");
1595 hm.put(
"bidirectional", tmp);
1600 hm.put(
"objectType",
"narrower");
1601 hm.put(
"action",
"add");
1602 for (Object item : newNarrower) {
1603 if (!oldNarrower.contains(item)) {
1604 String tmp = (String) item;
1605 hm.put(
"valueBefore",
"");
1606 hm.put(
"valueAfter", tmp);
1607 hm.put(
"bidirectional", tmp);
1613 }
else if (oldNarrower ==
null && newNarrower !=
null) {
1614 for (Object item : newNarrower) {
1615 String tmp = (String) item;
1616 hm.put(
"objectType",
"narrower");
1617 hm.put(
"action",
"add");
1618 hm.put(
"valueBefore",
"");
1619 hm.put(
"valueAfter", tmp);
1620 hm.put(
"bidirectional", tmp);
1622 }
else if (oldNarrower !=
null && newNarrower ==
null) {
1623 for (Object item : oldNarrower) {
1624 String tmp = (String) item;
1625 hm.put(
"objectType",
"narrower");
1626 hm.put(
"action",
"delete");
1627 hm.put(
"valueBefore", tmp);
1628 hm.put(
"valueAfter",
"");
1629 hm.put(
"bidirectional", tmp);
1634 if (oldRelated !=
null && newRelated !=
null) {
1635 if (!oldRelated.equals(newRelated)) {
1636 if (oldRelated.size() == newRelated.size()) {
1637 hm.put(
"objectType",
"related");
1638 hm.put(
"action",
"modify");
1639 JSONArray oldRelatedTmp = oldRelated;
1640 JSONArray newRelatedTmp = newRelated;
1641 oldRelatedTmp.removeAll(newRelatedTmp);
1642 for (Object item : oldRelated) {
1643 String tmp = (String) item;
1644 hm.put(
"valueBefore", tmp);
1645 hm.put(
"bidirectional", tmp);
1646 hm.put(
"bidirectional-del", tmp);
1648 for (Object item : newRelated) {
1649 String tmp = (String) item;
1650 hm.put(
"valueAfter", tmp);
1651 hm.put(
"bidirectional-add", tmp);
1653 }
else if (oldRelated.size() > newRelated.size()) {
1654 hm.put(
"objectType",
"related");
1655 hm.put(
"action",
"delete");
1656 for (Object item : oldRelated) {
1657 if (!newRelated.contains(item)) {
1658 String tmp = (String) item;
1659 hm.put(
"valueBefore", tmp);
1660 hm.put(
"valueAfter",
"");
1661 hm.put(
"bidirectional", tmp);
1666 hm.put(
"objectType",
"related");
1667 hm.put(
"action",
"add");
1668 for (Object item : newRelated) {
1669 if (!oldRelated.contains(item)) {
1670 String tmp = (String) item;
1671 hm.put(
"valueBefore",
"");
1672 hm.put(
"valueAfter", tmp);
1673 hm.put(
"bidirectional", tmp);
1679 }
else if (oldRelated ==
null && newRelated !=
null) {
1680 for (Object item : newRelated) {
1681 String tmp = (String) item;
1682 hm.put(
"objectType",
"related");
1683 hm.put(
"action",
"add");
1684 hm.put(
"valueBefore",
"");
1685 hm.put(
"valueAfter", tmp);
1686 hm.put(
"bidirectional", tmp);
1688 }
else if (oldRelated !=
null && newRelated ==
null) {
1689 for (Object item : oldRelated) {
1690 String tmp = (String) item;
1691 hm.put(
"objectType",
"related");
1692 hm.put(
"action",
"delete");
1693 hm.put(
"valueBefore", tmp);
1694 hm.put(
"valueAfter",
"");
1695 hm.put(
"bidirectional", tmp);
1700 if (oldBroadMatch !=
null && newBroadMatch !=
null) {
1701 if (!oldBroadMatch.equals(newBroadMatch)) {
1702 if (oldBroadMatch.size() == newBroadMatch.size()) {
1703 hm.put(
"objectType",
"broadMatch");
1704 hm.put(
"action",
"modify");
1705 JSONArray oldBroadMatchTmp = oldBroadMatch;
1706 JSONArray newBroadMatchTmp = newBroadMatch;
1707 oldBroadMatchTmp.removeAll(newBroadMatchTmp);
1708 for (Object item : oldBroadMatchTmp) {
1709 JSONObject tmp = (JSONObject) item;
1710 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1712 for (Object item : newBroadMatchTmp) {
1713 JSONObject tmp = (JSONObject) item;
1714 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1716 }
else if (oldBroadMatch.size() > newBroadMatch.size()) {
1717 hm.put(
"objectType",
"broadMatch");
1718 hm.put(
"action",
"delete");
1719 for (Object item : oldBroadMatch) {
1720 if (!newBroadMatch.contains(item)) {
1721 JSONObject tmp = (JSONObject) item;
1722 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1723 hm.put(
"valueAfter",
"");
1728 hm.put(
"objectType",
"broadMatch");
1729 hm.put(
"action",
"add");
1730 for (Object item : newBroadMatch) {
1731 if (!oldBroadMatch.contains(item)) {
1732 JSONObject tmp = (JSONObject) item;
1733 hm.put(
"valueBefore",
"");
1734 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1740 }
else if (oldBroadMatch ==
null && newBroadMatch !=
null) {
1741 for (Object item : newBroadMatch) {
1742 JSONObject tmp = (JSONObject) item;
1743 hm.put(
"objectType",
"broadMatch");
1744 hm.put(
"action",
"add");
1745 hm.put(
"valueBefore",
"");
1746 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1748 }
else if (oldBroadMatch !=
null && newBroadMatch ==
null) {
1749 for (Object item : oldBroadMatch) {
1750 JSONObject tmp = (JSONObject) item;
1751 hm.put(
"objectType",
"broadMatch");
1752 hm.put(
"action",
"delete");
1753 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1754 hm.put(
"valueAfter",
"");
1759 if (oldNarrowMatch !=
null && newNarrowMatch !=
null) {
1760 if (!oldNarrowMatch.equals(newNarrowMatch)) {
1761 if (oldNarrowMatch.size() == newNarrowMatch.size()) {
1762 hm.put(
"objectType",
"narrowMatch");
1763 hm.put(
"action",
"modify");
1764 JSONArray oldNarrowMatchTmp = oldNarrowMatch;
1765 JSONArray newNarrowMatchTmp = newNarrowMatch;
1766 oldNarrowMatchTmp.removeAll(newNarrowMatchTmp);
1767 for (Object item : oldNarrowMatchTmp) {
1768 JSONObject tmp = (JSONObject) item;
1769 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1771 for (Object item : newNarrowMatchTmp) {
1772 JSONObject tmp = (JSONObject) item;
1773 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1775 }
else if (oldNarrowMatch.size() > newNarrowMatch.size()) {
1776 hm.put(
"objectType",
"narrowMatch");
1777 hm.put(
"action",
"delete");
1778 for (Object item : oldNarrowMatch) {
1779 if (!newNarrowMatch.contains(item)) {
1780 JSONObject tmp = (JSONObject) item;
1781 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1782 hm.put(
"valueAfter",
"");
1787 hm.put(
"objectType",
"narrowMatch");
1788 hm.put(
"action",
"add");
1789 for (Object item : newNarrowMatch) {
1790 if (!oldNarrowMatch.contains(item)) {
1791 JSONObject tmp = (JSONObject) item;
1792 hm.put(
"valueBefore",
"");
1793 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1799 }
else if (oldNarrowMatch ==
null && newNarrowMatch !=
null) {
1800 for (Object item : newNarrowMatch) {
1801 JSONObject tmp = (JSONObject) item;
1802 hm.put(
"objectType",
"narrowMatch");
1803 hm.put(
"action",
"add");
1804 hm.put(
"valueBefore",
"");
1805 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1807 }
else if (oldNarrowMatch !=
null && newNarrowMatch ==
null) {
1808 for (Object item : oldNarrowMatch) {
1809 JSONObject tmp = (JSONObject) item;
1810 hm.put(
"objectType",
"narrowMatch");
1811 hm.put(
"action",
"delete");
1812 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1813 hm.put(
"valueAfter",
"");
1818 if (oldRelatedMatch !=
null && newRelatedMatch !=
null) {
1819 if (!oldRelatedMatch.equals(newRelatedMatch)) {
1820 if (oldRelatedMatch.size() == newRelatedMatch.size()) {
1821 hm.put(
"objectType",
"relatedMatch");
1822 hm.put(
"action",
"modify");
1823 JSONArray oldRelatedMatchTmp = oldRelatedMatch;
1824 JSONArray newRelatedMatchTmp = newRelatedMatch;
1825 oldRelatedMatchTmp.removeAll(newRelatedMatchTmp);
1826 for (Object item : oldRelatedMatchTmp) {
1827 JSONObject tmp = (JSONObject) item;
1828 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1830 for (Object item : newRelatedMatchTmp) {
1831 JSONObject tmp = (JSONObject) item;
1832 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1834 }
else if (oldRelatedMatch.size() > newRelatedMatch.size()) {
1835 hm.put(
"objectType",
"relatedMatch");
1836 hm.put(
"action",
"delete");
1837 for (Object item : oldRelatedMatch) {
1838 if (!newRelatedMatch.contains(item)) {
1839 JSONObject tmp = (JSONObject) item;
1840 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1841 hm.put(
"valueAfter",
"");
1846 hm.put(
"objectType",
"relatedMatch");
1847 hm.put(
"action",
"add");
1848 for (Object item : newRelatedMatch) {
1849 if (!oldRelatedMatch.contains(item)) {
1850 JSONObject tmp = (JSONObject) item;
1851 hm.put(
"valueBefore",
"");
1852 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1858 }
else if (oldRelatedMatch ==
null && newRelatedMatch !=
null) {
1859 for (Object item : newRelatedMatch) {
1860 JSONObject tmp = (JSONObject) item;
1861 hm.put(
"objectType",
"relatedMatch");
1862 hm.put(
"action",
"add");
1863 hm.put(
"valueBefore",
"");
1864 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1866 }
else if (oldRelatedMatch !=
null && newRelatedMatch ==
null) {
1867 for (Object item : oldRelatedMatch) {
1868 JSONObject tmp = (JSONObject) item;
1869 hm.put(
"objectType",
"relatedMatch");
1870 hm.put(
"action",
"delete");
1871 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1872 hm.put(
"valueAfter",
"");
1877 if (oldCloseMatch !=
null && newCloseMatch !=
null) {
1878 if (!oldCloseMatch.equals(newCloseMatch)) {
1879 if (oldCloseMatch.size() == newCloseMatch.size()) {
1880 hm.put(
"objectType",
"closeMatch");
1881 hm.put(
"action",
"modify");
1882 JSONArray oldCloseMatchTmp = oldCloseMatch;
1883 JSONArray newCloseMatchTmp = newCloseMatch;
1884 oldCloseMatchTmp.removeAll(newCloseMatchTmp);
1885 for (Object item : oldCloseMatchTmp) {
1886 JSONObject tmp = (JSONObject) item;
1887 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1889 for (Object item : newCloseMatchTmp) {
1890 JSONObject tmp = (JSONObject) item;
1891 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1893 }
else if (oldCloseMatch.size() > newCloseMatch.size()) {
1894 hm.put(
"objectType",
"closeMatch");
1895 hm.put(
"action",
"delete");
1896 for (Object item : oldCloseMatch) {
1897 if (!newCloseMatch.contains(item)) {
1898 JSONObject tmp = (JSONObject) item;
1899 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1900 hm.put(
"valueAfter",
"");
1905 hm.put(
"objectType",
"closeMatch");
1906 hm.put(
"action",
"add");
1907 for (Object item : newCloseMatch) {
1908 if (!oldCloseMatch.contains(item)) {
1909 JSONObject tmp = (JSONObject) item;
1910 hm.put(
"valueBefore",
"");
1911 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1917 }
else if (oldCloseMatch ==
null && newCloseMatch !=
null) {
1918 for (Object item : newCloseMatch) {
1919 JSONObject tmp = (JSONObject) item;
1920 hm.put(
"objectType",
"closeMatch");
1921 hm.put(
"action",
"add");
1922 hm.put(
"valueBefore",
"");
1923 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1925 }
else if (oldCloseMatch !=
null && newCloseMatch ==
null) {
1926 for (Object item : oldCloseMatch) {
1927 JSONObject tmp = (JSONObject) item;
1928 hm.put(
"objectType",
"closeMatch");
1929 hm.put(
"action",
"delete");
1930 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1931 hm.put(
"valueAfter",
"");
1936 if (oldExactMatch !=
null && newExactMatch !=
null) {
1937 if (!oldExactMatch.equals(newExactMatch)) {
1938 if (oldExactMatch.size() == newExactMatch.size()) {
1939 hm.put(
"objectType",
"exactMatch");
1940 hm.put(
"action",
"modify");
1941 JSONArray oldExactMatchTmp = oldExactMatch;
1942 JSONArray newExactMatchTmp = newExactMatch;
1943 oldExactMatchTmp.removeAll(newExactMatchTmp);
1944 for (Object item : oldExactMatchTmp) {
1945 JSONObject tmp = (JSONObject) item;
1946 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1948 for (Object item : newExactMatchTmp) {
1949 JSONObject tmp = (JSONObject) item;
1950 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1952 }
else if (oldExactMatch.size() > newExactMatch.size()) {
1953 hm.put(
"objectType",
"exactMatch");
1954 hm.put(
"action",
"delete");
1955 for (Object item : oldExactMatch) {
1956 if (!newExactMatch.contains(item)) {
1957 JSONObject tmp = (JSONObject) item;
1958 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1959 hm.put(
"valueAfter",
"");
1964 hm.put(
"objectType",
"exactMatch");
1965 hm.put(
"action",
"add");
1966 for (Object item : newExactMatch) {
1967 if (!oldExactMatch.contains(item)) {
1968 JSONObject tmp = (JSONObject) item;
1969 hm.put(
"valueBefore",
"");
1970 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1976 }
else if (oldExactMatch ==
null && newExactMatch !=
null) {
1977 for (Object item : newExactMatch) {
1978 JSONObject tmp = (JSONObject) item;
1979 hm.put(
"objectType",
"exactMatch");
1980 hm.put(
"action",
"add");
1981 hm.put(
"valueBefore",
"");
1982 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1983 String tmpUriSplit[] = tmp.get(
"uri").toString().split(
"/");
1984 hm.put(
"bidirectional", tmpUriSplit[tmpUriSplit.length - 1]);
1986 }
else if (oldExactMatch !=
null && newExactMatch ==
null) {
1987 for (Object item : oldExactMatch) {
1988 JSONObject tmp = (JSONObject) item;
1989 hm.put(
"objectType",
"exactMatch");
1990 hm.put(
"action",
"delete");
1991 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
1992 hm.put(
"valueAfter",
"");
1993 String tmpUriSplit[] = tmp.get(
"uri").toString().split(
"/");
1994 hm.put(
"bidirectional", tmpUriSplit[tmpUriSplit.length - 1]);
1999 if (oldSeeAlso !=
null && newSeeAlso !=
null) {
2000 if (!oldSeeAlso.equals(newSeeAlso)) {
2001 if (oldSeeAlso.size() == newSeeAlso.size()) {
2002 hm.put(
"objectType",
"seeAlso");
2003 hm.put(
"action",
"modify");
2004 JSONArray oldSeeAlsoTmp = oldSeeAlso;
2005 JSONArray newSeeAlsoTmp = newSeeAlso;
2006 oldSeeAlsoTmp.removeAll(newSeeAlsoTmp);
2007 for (Object item : oldSeeAlsoTmp) {
2008 JSONObject tmp = (JSONObject) item;
2009 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
2011 for (Object item : newSeeAlsoTmp) {
2012 JSONObject tmp = (JSONObject) item;
2013 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
2015 }
else if (oldSeeAlso.size() > newSeeAlso.size()) {
2016 hm.put(
"objectType",
"seeAlso");
2017 hm.put(
"action",
"delete");
2018 for (Object item : oldSeeAlso) {
2019 if (!newSeeAlso.contains(item)) {
2020 JSONObject tmp = (JSONObject) item;
2021 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
2022 hm.put(
"valueAfter",
"");
2027 hm.put(
"objectType",
"seeAlso");
2028 hm.put(
"action",
"add");
2029 for (Object item : newSeeAlso) {
2030 if (!oldSeeAlso.contains(item)) {
2031 JSONObject tmp = (JSONObject) item;
2032 hm.put(
"valueBefore",
"");
2033 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
2039 }
else if (oldSeeAlso ==
null && newSeeAlso !=
null) {
2040 for (Object item : newSeeAlso) {
2041 JSONObject tmp = (JSONObject) item;
2042 hm.put(
"objectType",
"seeAlso");
2043 hm.put(
"action",
"add");
2044 hm.put(
"valueBefore",
"");
2045 hm.put(
"valueAfter", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
2047 }
else if (oldSeeAlso !=
null && newSeeAlso ==
null) {
2048 for (Object item : oldSeeAlso) {
2049 JSONObject tmp = (JSONObject) item;
2050 hm.put(
"objectType",
"seeAlso");
2051 hm.put(
"action",
"delete");
2052 hm.put(
"valueBefore", tmp.get(
"uri") +
" (" + tmp.get(
"type") +
")");
2053 hm.put(
"valueAfter",
"");
2060 for (StackTraceElement element : e.getStackTrace()) {
2061 errorLine = element.getLineNumber();
2062 if (element.getClassName().equals(Transformer.class.getName())) {