Summary
A structured vocabulary is a description of concepts and their relations in a domain. Concepts are vocabulary words or terms with an accession and a definition. Concepts within the same domain (namespace) may have relations to each other, such as concept B is-a concept A and concept C is-part-of concept B. Concepts in different domains may have projections to each other through a mapping across domains. For example, concept A in domain 1 is-similar-to concept A in domain 2 through a mapping of domain 1 to domain 2. Domains and mappings have an authority.
Assignable entities can be annotated with structured vocabularies by assignment to a concept. For example, a business object can be assigned to concepts A and C in domain 1 and to concept A in domain 2. Assignments are supported by evidence and have an authority.
Bookmark example
As a concrete example, consider topics for categorizing bookmarks. A bookmark that can be annotated using a structured vocabulary can be implemented in one of two designs, either by extending the AbstractAssignable class:
class Bookmark extends AbstractAssignable { private String name; private String description; private URL url; public Bookmark(final String name, final String description, final URL url) { super(); this.name = name; this.description = description; this.url = url; } // ... }
or by creating an AssignableBookmark class that extends a simple bookmark class and adds assignable support via delegation to AssignableSupport:
class Bookmark { private String name; private String description; private URL url; public Bookmark(final String name, final String description, final URL url) { this.name = name; this.description = description; this.url = url; } // ... } class AssignableBookmark extends Bookmark implements Assignable { private AssignableSupport assignableSupport; public AssignableBookmark(final String name, final String description, final URL url) { super(name, description, url); assignableSupport = new AssignableSupport(this); } /** @see Assignable */ public Set<Assignment> getAssignments() { return assignableSupport.getAssignments(); } /** @see Assignable */ public void addAssignment(final Assignment assignment) { assignableSupport.addAssignment(assignment); } }
Define a structured vocabulary with a local authority.
Authority localhost = new SimpleAuthority("localhost"); Domain topics = localhost.createDomain("topics"); Concept viz = topics.createConcept("data visualization", ...); Concept gd = topics.createConcept("graph drawing", ...); Concept hci = topics.createConcept("human-computer interaction", ...); Concept net = topics.creatConcept("complex networks", ...); // graph drawing is part of data visualization topics.createRelation("part-of", gd, viz); // data visualization is a human-computer interaction topics.createRelation("is-a", viz, hci); // graph drawing is part of complex networks topics.createRelation("part-of", gd, net); // data visualization is part of complex networks topics.createRelation("part-of", viz, net);
Assign bookmarks to the various topics with evidence.
Bookmark b0 = new Bookmark(...); Bookmark b1 = new Bookmark(...); Bookmark b2 = new Bookmark(...); Bookmark b3 = new Bookmark(...); Set<Evidence> weak = Collections.singleton(new Evidence("weak assertion", 0.5d, 1.0d)); Set<Evidence> strong = Collections.singleton(new Evidence("strong assertion", 1.0d, 1.0d)); localhost.createAssignment(gd, b0, strong); localhost.createAssignment(gd, b1, weak); localhost.createAssignment(viz, b1, strong); localhost.createAssignment(net, b2, strong); localhost.createAssignment(gd, b2, weak); localhost.createAssignment(net, b3, strong);
Define a mapping from an external structured vocabulary, the ACM Computing Classification System ( http://www.acm.org/class/1998 ) for example, to the local topics. Create projections from concepts in the external domain to those in the local one.
Authority acm = new SimpleAuthority("www.acm.org"); Domain ccs = acm.createDomain("1998 ACM Computing Classification System"); Concept g = ccs.createConcept("G. Mathemetics of Computing", "G.", ...); Concept g2 = ccs.createConcept("G.2 DISCRETE MATHEMATICS", "G.2", ...); Concept g22 = ccs.createConcept("G.2.2. Graph Theory", "G.2.2", ...); ccs.createRelation("part-of", g2, g); ccs.createRelation("part-of", g22, g2); Mapping mapping = localhost.createMapping(ccs, topics); mapping.createProjection("is-similar-to", g22, net, strong);
The assignments, relations, and projections can then be traversed in either the forward or reverse direction to annotate entities or concepts as necessary.
Acknowledgements
- Powered by Maven.
- Project hosting by SourceForge.net.