|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.extractor.rdfa.RDFa11Parser
public class RDFa11Parser
This parser is able to extract RDFa 1.0 and RDFa 1.1 statements from any (X)HTML document.
Field Summary | |
---|---|
static String |
ABOUT_ATTRIBUTE
|
static String |
BODY_TAG
|
static String |
CONTENT_ATTRIBUTE
|
static String |
CURIE_SEPARATOR
|
static String |
DATATYPE_ATTRIBUTE
|
static String |
HEAD_TAG
|
static String |
HREF_ATTRIBUTE
|
static String |
PREFIX_ATTRIBUTE
|
static String |
PROFILE_ATTRIBUTE
|
static String |
PROPERTY_ATTRIBUTE
|
static String |
REL_ATTRIBUTE
|
static String |
RESOURCE_ATTRIBUTE
|
static String |
REV_ATTRIBUTE
|
static String |
SRC_ATTRIBUTE
|
static String[] |
SUBJECT_ATTRIBUTES
|
static String |
TYPEOF_ATTRIBUTE
|
static String |
URI_PATH_SEPARATOR
|
static char |
URI_PREFIX_SEPARATOR
|
static String |
URI_SCHEMA_SEPARATOR
|
static String |
VOCAB_ATTRIBUTE
|
static String |
XML_LANG_ATTRIBUTE
|
static String |
XML_LITERAL_DATATYPE
|
static String |
XMLNS_ATTRIBUTE
|
static String |
XMLNS_DEFAULT
|
Constructor Summary | |
---|---|
RDFa11Parser()
|
Method Summary | |
---|---|
protected static String[] |
extractPrefixSections(String prefixesDeclaration)
Given a prefix declaration returns a list of prefixID:prefixURL strings
normalizing blanks where present. |
protected static org.openrdf.model.Literal |
getAsPlainLiteral(Node node,
String currentLanguage)
|
protected static org.openrdf.model.Literal |
getAsXMLLiteral(Node node)
|
protected static URL |
getDocumentBase(URL documentURL,
Document document)
|
protected org.openrdf.model.URI |
getMapping(String prefix)
Returns a URI mapping for a given prefix. |
protected static boolean |
isAbsoluteURI(String uri)
|
protected static boolean |
isCURIE(String curie)
|
protected static boolean |
isCURIEBNode(String curie)
|
protected static boolean |
isRelativeNode(Node node)
|
protected static boolean |
isXMLNSDeclared(Document document)
|
void |
processDocument(URL documentURL,
Document document,
ExtractionResult extractionResult)
RDFa Syntax - Processing Model. |
void |
reset()
Resets the parser to the original state. |
protected org.openrdf.model.Resource |
resolveCURIEOrURI(String curieOrURI,
boolean termAllowed)
Resolves a CURIE or URI string. |
protected org.openrdf.model.URI[] |
resolveCurieOrURIList(Node n,
String curieOrURIList,
boolean termAllowed)
Resolves a |
protected org.openrdf.model.URI |
resolveURI(String uriStr)
Resolves a URI string as URI. |
protected void |
updateURIMapping(Node node)
Updates the URI mapping with the XMLNS attributes declared in the current node. |
protected void |
updateVocabulary(Node currentNode)
Updates the vocabulary context with possible @vocab declarations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CURIE_SEPARATOR
public static final char URI_PREFIX_SEPARATOR
public static final String URI_SCHEMA_SEPARATOR
public static final String URI_PATH_SEPARATOR
public static final String HEAD_TAG
public static final String BODY_TAG
public static final String XMLNS_ATTRIBUTE
public static final String XML_LANG_ATTRIBUTE
public static final String REL_ATTRIBUTE
public static final String REV_ATTRIBUTE
public static final String ABOUT_ATTRIBUTE
public static final String RESOURCE_ATTRIBUTE
public static final String SRC_ATTRIBUTE
public static final String HREF_ATTRIBUTE
public static final String[] SUBJECT_ATTRIBUTES
public static final String PREFIX_ATTRIBUTE
public static final String TYPEOF_ATTRIBUTE
public static final String PROPERTY_ATTRIBUTE
public static final String DATATYPE_ATTRIBUTE
public static final String CONTENT_ATTRIBUTE
public static final String VOCAB_ATTRIBUTE
public static final String PROFILE_ATTRIBUTE
public static final String XML_LITERAL_DATATYPE
public static final String XMLNS_DEFAULT
Constructor Detail |
---|
public RDFa11Parser()
Method Detail |
---|
protected static URL getDocumentBase(URL documentURL, Document document) throws MalformedURLException
MalformedURLException
protected static String[] extractPrefixSections(String prefixesDeclaration)
prefixID:prefixURL
strings
normalizing blanks where present.
prefixesDeclaration
-
protected static boolean isAbsoluteURI(String uri)
protected static boolean isCURIE(String curie)
protected static boolean isCURIEBNode(String curie)
protected static boolean isRelativeNode(Node node)
protected static org.openrdf.model.Literal getAsPlainLiteral(Node node, String currentLanguage)
protected static org.openrdf.model.Literal getAsXMLLiteral(Node node) throws IOException, TransformerException
IOException
TransformerException
protected static boolean isXMLNSDeclared(Document document)
public void processDocument(URL documentURL, Document document, ExtractionResult extractionResult) throws RDFa11ParserException
documentURL
- extractionResult
- document
-
RDFa11ParserException
public void reset()
protected void updateVocabulary(Node currentNode)
currentNode
- the current node.protected void updateURIMapping(Node node)
node
- input node.protected org.openrdf.model.URI getMapping(String prefix)
prefix
- input prefix.
protected org.openrdf.model.URI[] resolveCurieOrURIList(Node n, String curieOrURIList, boolean termAllowed) throws URISyntaxException
n
- current node.curieOrURIList
- list of CURIE/URI.
URISyntaxException
protected org.openrdf.model.URI resolveURI(String uriStr)
uriStr
-
protected org.openrdf.model.Resource resolveCURIEOrURI(String curieOrURI, boolean termAllowed)
curieOrURI
- termAllowed
- if true
the resolution can be a term.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |