Class OntolexBasedRDFDataHandler
java.lang.Object
org.getalp.dbnary.model.DbnaryModel
org.getalp.dbnary.languages.OntolexBasedRDFDataHandler
- All Implemented Interfaces:
IWiktionaryDataHandler
- Direct Known Subclasses:
PostTranslationDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler, WiktionaryDataHandler
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.jena.rdf.model.ModelDeprecated.use getFeatureBox()protected org.apache.jena.rdf.model.Resourceprotected Stringprotected org.apache.jena.rdf.model.ResourceDeprecated.protected LexicalEntryprotected CounterSetDeprecated.protected org.apache.jena.rdf.model.ResourceDeprecated.should rely on currentPage (not a Resource anymoreprotected Pageprotected org.apache.jena.rdf.model.Resourceprotected HierarchicalSenseNumberprotected Set<PronunciationPair> protected final AbstractGlossFilterprotected org.apache.jena.rdf.model.Resourceprotected org.apache.jena.rdf.model.Resourceprotected final Stringprotected Stringprotected intprotected static HashMap<String, OntolexBasedRDFDataHandler.PosAndType> protected CounterSetprotected final Stringprotected Stringprotected CounterSetprotected StringFields inherited from class DbnaryModel
DBNARY_NS_PREFIX, LEXVO, tBox -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddOtherFormPropertiesToLexicalEntry(org.apache.jena.rdf.model.Resource lexEntry, HashSet<PropertyObjectPair> properties) org.apache.jena.rdf.model.ResourceaddTo(org.apache.jena.rdf.model.Resource target, Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> pv) org.apache.jena.rdf.model.ResourceaddToCurrentWordSense(Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> pv) voidbuildDatacubeObservations(String l, org.getalp.dbnary.enhancer.evaluation.TranslationGlossesStat tgs, org.getalp.dbnary.enhancer.evaluation.EvaluationStats.Stat es, String dumpFileVersion) voidclose the dataset that eventually backs up the different feature boxes.protected StringcomputeNymId(String nym) protected StringcomputeNymId(String nym, String pagename) protected StringcomputeOtherFormResourceName(org.apache.jena.rdf.model.Resource lexEntry, HashSet<PropertyObjectPair> properties) protected StringvoidcomputeStatistics(org.apache.jena.rdf.model.Model statsModel, org.apache.jena.rdf.model.Model sourceModel, String dumpVersion) static voidcreateGeneralStatisticsObservation(org.apache.jena.rdf.model.Model statsBox, String dumpVersion, String prefix, String lang, long translationCount, long pageCount, long entryCount, long senseCount) org.apache.jena.rdf.model.ResourcecreateGlossResource(String gloss) org.apache.jena.rdf.model.ResourcecreateGlossResource(String gloss, int rank) org.apache.jena.rdf.model.Resourceorg.apache.jena.rdf.model.ResourcecreateGlossResource(StructuredGloss gloss, int rank) static voidcreateNymRelationObservation(org.apache.jena.rdf.model.Model box, String dumpVersion, String prefix, String lang, NymRelation nym, long cr) static voidcreateTranslationObservation(org.apache.jena.rdf.model.Model statsBox, String dumpVersion, String prefix, String sourceLanguage, String targetLanguage, long c) org.apache.jena.rdf.model.Resourceprotected OntolexBasedRDFDataHandler.PosAndTypedecodePartOfSpeech(String pos) voiddump(org.apache.jena.rdf.model.Model box, OutputStream out, String format) Write a serialized represention of this model in a specified language.voiddumpAllFeaturesAsHDT(OutputStream ostream, boolean isExolex) voidEnable the extraction of morphological data in a second Model if available.voidvoidvoidreturns the language of the current EntrygetDerivationStatementId(String derived) getEncodedPageName(String pageName, String pos, int defNumber) org.apache.jena.rdf.model.Modelorg.apache.jena.rdf.model.Modelreturns the short (2 letter code) id of the language of the language editionorg.apache.jena.rdf.model.Modelprotected Stringorg.apache.jena.rdf.model.ResourcegetLexEntry(String languageCode, String pageName, String pos, int defNumber) org.apache.jena.rdf.model.ResourcegetLexEntry(String encodedPageName, org.apache.jena.rdf.model.Resource typeResource) org.apache.jena.rdf.model.ResourcegetPageResource(String page) org.apache.jena.rdf.model.ResourcegetPageResource(String vocable, boolean dontLinkWithType) getPageResourceIRI(String vocable) voidinitializeLanguageSection(String language) voidprotected org.apache.jena.rdf.model.ResourceinitializeLexicalEntry(String pos, org.apache.jena.rdf.model.Resource lexinfoPOS, org.apache.jena.rdf.model.Resource type) org.apache.jena.rdf.model.ResourceinitializeLexicalEntry__noModel(String originalPOS, org.apache.jena.rdf.model.Resource normalizedPOS, org.apache.jena.rdf.model.Resource normalizedType) voidinitializePageExtraction(String wiktionaryPageName) booleanprotected booleanisResourceCompatible(org.apache.jena.rdf.model.Resource r, HashSet<PropertyObjectPair> properties) protected voidmergePropertiesIntoResource(HashSet<PropertyObjectPair> properties, org.apache.jena.rdf.model.Resource res) intvoidpopulateMetadata(org.apache.jena.rdf.model.Model metadataModel, org.apache.jena.rdf.model.Model sourceModel, String dumpFilename, String extractorVersion, boolean isExolex) //// METADATA /////////org.apache.jena.rdf.model.ResourceposResource(String pos) org.apache.jena.rdf.model.ResourcevoidvoidregisterDerivation(String derived) voidregisterDerivation(String derived, String note) org.apache.jena.rdf.model.ResourceregisterExample(String ex, Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context) Register example ex for the current lexical sense.org.apache.jena.rdf.model.ResourceregisterExample(Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context) org.apache.jena.rdf.model.ResourceregisterExampleOnResource(String ex, Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context, org.apache.jena.rdf.model.Resource sense) Register example ex for a given lexical sense.org.apache.jena.rdf.model.ResourceregisterExampleOnResource(Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context, org.apache.jena.rdf.model.Resource sense) voidregisterInflection(String languageCode, String pos, String inflection, String canonicalForm, int defNumber, HashSet<PropertyObjectPair> props) voidregisterInflection(String languageCode, String pos, String inflection, String canonicalForm, int defNumber, HashSet<PropertyObjectPair> props, HashSet<PronunciationPair> pronunciations) voidregisterInflection(InflectionData key, Set<String> value) org.apache.jena.rdf.model.ResourceRegister definition def for the current lexical entry.org.apache.jena.rdf.model.ResourceregisterNewDefinition(String def, int lvl) Register definition def for the current lexical entry.org.apache.jena.rdf.model.ResourceregisterNewDefinition(String def, String senseNumber) Register a definition with the given sense number.voidregisterNymRelation(String target, String synRelation) voidregisterNymRelation(String target, String synRelation, org.apache.jena.rdf.model.Resource gloss, String usage) voidregisterNymRelationOnCurrentSense(String target, String synRelation, org.apache.jena.rdf.model.Resource gloss, String usage) voidregisterNymRelationToEntity(String target, String synRelation, org.apache.jena.rdf.model.Resource entity) voidregisterNymRelationToEntity(String target, String nymRelation, org.apache.jena.rdf.model.Resource entity, org.apache.jena.rdf.model.Resource gloss, String usage) voidregisterPronunciation(String pron, String lang) protected voidregisterPronunciation(org.apache.jena.rdf.model.Resource writtenRepresentation, String pron, String lang) voidregisterPropertyOnCanonicalForm(org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode r) voidregisterPropertyOnLexicalEntry(org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode r) voidregisterTranslation(String lang, org.apache.jena.rdf.model.Resource currentGloss, String usage, String word) org.apache.jena.rdf.model.ResourceregisterTranslationToEntity(org.apache.jena.rdf.model.Resource entity, String lang, org.apache.jena.rdf.model.Resource currentGloss, String usage, String word) org.apache.jena.rdf.model.ResourcetypeResource(String pos) org.apache.jena.rdf.model.ResourceMethods inherited from class DbnaryModel
setGlobalDbnaryPrefix, uriEncode, uriEncode, uriEncodeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IWiktionaryDataHandler
registerNymRelationOnCurrentSense
-
Field Details
-
aBox
Deprecated.use getFeatureBox() -
currentLexEntry
Deprecated. -
currentLexicalEntry
-
currentSense
protected org.apache.jena.rdf.model.Resource currentSense -
currentSenseNumber
-
translationCount
-
reifiedNymCount
-
shortEditionLanguageCode
-
longEditionLanguageCode
-
shortSectionLanguageCode
-
longSectionLanguageCode
-
lexvoExtractedLanguage
protected org.apache.jena.rdf.model.Resource lexvoExtractedLanguage -
lexvoSectionLanguage
protected org.apache.jena.rdf.model.Resource lexvoSectionLanguage -
nbEntries
protected int nbEntries -
WIKT
-
currentEncodedLexicalEntryName
-
currentLexieCount
Deprecated. -
currentMainLexEntry
Deprecated.should rely on currentPage (not a Resource anymore -
currentPage
-
currentCanonicalForm
protected org.apache.jena.rdf.model.Resource currentCanonicalForm -
posAndTypeValueMap
-
glossFilter
-
-
Constructor Details
-
OntolexBasedRDFDataHandler
-
-
Method Details
-
getCurrentEntryLanguage
returns the language of the current Entry- Specified by:
getCurrentEntryLanguagein interfaceIWiktionaryDataHandler- Returns:
- a language code
-
getExtractedLanguage
Description copied from interface:IWiktionaryDataHandlerreturns the short (2 letter code) id of the language of the language edition- Specified by:
getExtractedLanguagein interfaceIWiktionaryDataHandler- Returns:
- wiktionary edition short language code
-
closeDataset
public void closeDataset()Description copied from interface:IWiktionaryDataHandlerclose the dataset that eventually backs up the different feature boxes.Does nothing when there is no dataset backing up the boxes.
- Specified by:
closeDatasetin interfaceIWiktionaryDataHandler
-
enableEndolexFeatures
Description copied from interface:IWiktionaryDataHandlerEnable the extraction of morphological data in a second Model if available.- Specified by:
enableEndolexFeaturesin interfaceIWiktionaryDataHandler- Parameters:
f- Feature
-
getFeatureBox
- Specified by:
getFeatureBoxin interfaceIWiktionaryDataHandler
-
getEndolexFeatureBox
- Specified by:
getEndolexFeatureBoxin interfaceIWiktionaryDataHandler
-
getExolexFeatureBox
- Specified by:
getExolexFeatureBoxin interfaceIWiktionaryDataHandler
-
enableExolexFeatures
- Specified by:
enableExolexFeaturesin interfaceIWiktionaryDataHandler
-
isDisabled
- Specified by:
isDisabledin interfaceIWiktionaryDataHandler
-
initializePageExtraction
- Specified by:
initializePageExtractionin interfaceIWiktionaryDataHandler
-
finalizePageExtraction
public void finalizePageExtraction()- Specified by:
finalizePageExtractionin interfaceIWiktionaryDataHandler
-
initializeLanguageSection
- Specified by:
initializeLanguageSectionin interfaceIWiktionaryDataHandler
-
finalizeLanguageSection
public void finalizeLanguageSection()- Specified by:
finalizeLanguageSectionin interfaceIWiktionaryDataHandler
-
getEncodedPageName
-
getLexEntry
-
getLexEntry
public org.apache.jena.rdf.model.Resource getLexEntry(String encodedPageName, org.apache.jena.rdf.model.Resource typeResource) -
currentWiktionaryPos
- Specified by:
currentWiktionaryPosin interfaceIWiktionaryDataHandler
-
currentLexinfoPos
public org.apache.jena.rdf.model.Resource currentLexinfoPos()- Specified by:
currentLexinfoPosin interfaceIWiktionaryDataHandler
-
posResource
-
typeResource
-
posResource
-
typeResource
-
decodePartOfSpeech
-
initializeLexicalEntry
- Specified by:
initializeLexicalEntryin interfaceIWiktionaryDataHandler
-
initializeLexicalEntry
protected org.apache.jena.rdf.model.Resource initializeLexicalEntry(String pos, org.apache.jena.rdf.model.Resource lexinfoPOS, org.apache.jena.rdf.model.Resource type) -
initializeLexicalEntry__noModel
public org.apache.jena.rdf.model.Resource initializeLexicalEntry__noModel(String originalPOS, org.apache.jena.rdf.model.Resource normalizedPOS, org.apache.jena.rdf.model.Resource normalizedType) -
registerPropertyOnCanonicalForm
public void registerPropertyOnCanonicalForm(org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode r) - Specified by:
registerPropertyOnCanonicalFormin interfaceIWiktionaryDataHandler
-
registerPropertyOnLexicalEntry
public void registerPropertyOnLexicalEntry(org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode r) - Specified by:
registerPropertyOnLexicalEntryin interfaceIWiktionaryDataHandler
-
registerAlternateSpelling
- Specified by:
registerAlternateSpellingin interfaceIWiktionaryDataHandler
-
registerNewDefinition
Description copied from interface:IWiktionaryDataHandlerRegister definition def for the current lexical entry.This method will compute a sense number based on the rank of the definition in the entry.
It is equivalent to registerNewDefinition(def, 1);
- Specified by:
registerNewDefinitionin interfaceIWiktionaryDataHandler- Parameters:
def- a string- Returns:
-
registerNewDefinition
Description copied from interface:IWiktionaryDataHandlerRegister definition def for the current lexical entry.This method will compute a sense number based on the rank of the definition in the entry, taking into account the level of the definition. 1, 1a, 1b, 1c, 2, etc.
- Specified by:
registerNewDefinitionin interfaceIWiktionaryDataHandler- Parameters:
def- the definition stringlvl- an integer giving the level of the definition (1 or 2).- Returns:
-
registerNewDefinition
Register a definition with the given sense number.- Specified by:
registerNewDefinitionin interfaceIWiktionaryDataHandler- Parameters:
def- the definition stringsenseNumber- a string giving the sense number of the definition.- Returns:
-
computeSenseNum
-
registerTranslationToEntity
-
registerTranslation
public void registerTranslation(String lang, org.apache.jena.rdf.model.Resource currentGloss, String usage, String word) - Specified by:
registerTranslationin interfaceIWiktionaryDataHandler
-
getPageResourceIRI
-
getPageResource
-
getPageResource
-
mergePropertiesIntoResource
protected void mergePropertiesIntoResource(HashSet<PropertyObjectPair> properties, org.apache.jena.rdf.model.Resource res) -
isResourceCompatible
protected boolean isResourceCompatible(org.apache.jena.rdf.model.Resource r, HashSet<PropertyObjectPair> properties) -
addOtherFormPropertiesToLexicalEntry
protected void addOtherFormPropertiesToLexicalEntry(org.apache.jena.rdf.model.Resource lexEntry, HashSet<PropertyObjectPair> properties) -
computeOtherFormResourceName
protected String computeOtherFormResourceName(org.apache.jena.rdf.model.Resource lexEntry, HashSet<PropertyObjectPair> properties) -
registerDerivation
- Specified by:
registerDerivationin interfaceIWiktionaryDataHandler
-
registerDerivation
- Specified by:
registerDerivationin interfaceIWiktionaryDataHandler
-
getDerivationStatementId
-
registerInflection
public void registerInflection(String languageCode, String pos, String inflection, String canonicalForm, int defNumber, HashSet<PropertyObjectPair> props, HashSet<PronunciationPair> pronunciations) - Specified by:
registerInflectionin interfaceIWiktionaryDataHandler
-
registerInflection
public void registerInflection(String languageCode, String pos, String inflection, String canonicalForm, int defNumber, HashSet<PropertyObjectPair> props) - Specified by:
registerInflectionin interfaceIWiktionaryDataHandler- Parameters:
languageCode- the language code of the inflectionpos- the part of speech of the inflected forminflection- inflected formcanonicalForm- canonical formdefNumber- definition number of the word sense associated to the formprops- morpho syntactic properties to be registered with the inflected form
-
registerInflection
- Specified by:
registerInflectionin interfaceIWiktionaryDataHandler
-
registerNymRelationToEntity
-
registerNymRelationToEntity
-
registerNymRelation
- Specified by:
registerNymRelationin interfaceIWiktionaryDataHandler
-
getGlossFilter
- Specified by:
getGlossFilterin interfaceIWiktionaryDataHandler
-
createGlossResource
- Specified by:
createGlossResourcein interfaceIWiktionaryDataHandler
-
createGlossResource
- Specified by:
createGlossResourcein interfaceIWiktionaryDataHandler
-
createGlossResource
- Specified by:
createGlossResourcein interfaceIWiktionaryDataHandler
-
createGlossResource
- Specified by:
createGlossResourcein interfaceIWiktionaryDataHandler
-
getGlossResourceName
-
registerNymRelation
public void registerNymRelation(String target, String synRelation, org.apache.jena.rdf.model.Resource gloss, String usage) - Specified by:
registerNymRelationin interfaceIWiktionaryDataHandler
-
computeNymId
-
computeNymId
-
registerNymRelationOnCurrentSense
public void registerNymRelationOnCurrentSense(String target, String synRelation, org.apache.jena.rdf.model.Resource gloss, String usage) - Specified by:
registerNymRelationOnCurrentSensein interfaceIWiktionaryDataHandler
-
registerPronunciation
- Specified by:
registerPronunciationin interfaceIWiktionaryDataHandler
-
registerPronunciation
-
dump
Description copied from interface:IWiktionaryDataHandlerWrite a serialized represention of this model in a specified language. The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE", (and "TTL") and "N3". The default value, represented by null, is "RDF/XML".- Specified by:
dumpin interfaceIWiktionaryDataHandler- Parameters:
box- the Model to be dumpedout- an OutputStreamformat- a String
-
dumpAllFeaturesAsHDT
- Specified by:
dumpAllFeaturesAsHDTin interfaceIWiktionaryDataHandler
-
nbEntries
public int nbEntries()- Specified by:
nbEntriesin interfaceIWiktionaryDataHandler
-
currentPagename
- Specified by:
currentPagenamein interfaceIWiktionaryDataHandler
-
getPrefix
-
addTo
public org.apache.jena.rdf.model.Resource addTo(org.apache.jena.rdf.model.Resource target, Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> pv) - Specified by:
addToin interfaceIWiktionaryDataHandler
-
addToCurrentWordSense
public org.apache.jena.rdf.model.Resource addToCurrentWordSense(Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> pv) - Specified by:
addToCurrentWordSensein interfaceIWiktionaryDataHandler
-
registerExample
public org.apache.jena.rdf.model.Resource registerExample(String ex, Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context) Description copied from interface:IWiktionaryDataHandlerRegister example ex for the current lexical sense.- Specified by:
registerExamplein interfaceIWiktionaryDataHandler- Parameters:
ex- the example stringcontext- map of property + RDFNode that are to be attached to the example object.- Returns:
- a Resource
-
registerExampleOnResource
public org.apache.jena.rdf.model.Resource registerExampleOnResource(String ex, Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context, org.apache.jena.rdf.model.Resource sense) Description copied from interface:IWiktionaryDataHandlerRegister example ex for a given lexical sense.- Specified by:
registerExampleOnResourcein interfaceIWiktionaryDataHandler- Parameters:
ex- the example stringcontext- map of property + RDFNode that are to be attached to the example object.sense- the Resource of the lexical sens are to be attached with the example object.- Returns:
- a Resource
-
registerExample
public org.apache.jena.rdf.model.Resource registerExample(Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context) -
registerExampleOnResource
public org.apache.jena.rdf.model.Resource registerExampleOnResource(Set<org.apache.commons.lang3.tuple.Pair<org.apache.jena.rdf.model.Property, org.apache.jena.rdf.model.RDFNode>> context, org.apache.jena.rdf.model.Resource sense) -
computeStatistics
public void computeStatistics(org.apache.jena.rdf.model.Model statsModel, org.apache.jena.rdf.model.Model sourceModel, String dumpVersion) - Specified by:
computeStatisticsin interfaceIWiktionaryDataHandler
-
createGeneralStatisticsObservation
-
createNymRelationObservation
public static void createNymRelationObservation(org.apache.jena.rdf.model.Model box, String dumpVersion, String prefix, String lang, NymRelation nym, long cr) -
createTranslationObservation
-
populateMetadata
public void populateMetadata(org.apache.jena.rdf.model.Model metadataModel, org.apache.jena.rdf.model.Model sourceModel, String dumpFilename, String extractorVersion, boolean isExolex) //// METADATA /////////- Specified by:
populateMetadatain interfaceIWiktionaryDataHandler
-
buildDatacubeObservations
public void buildDatacubeObservations(String l, org.getalp.dbnary.enhancer.evaluation.TranslationGlossesStat tgs, org.getalp.dbnary.enhancer.evaluation.EvaluationStats.Stat es, String dumpFileVersion) - Specified by:
buildDatacubeObservationsin interfaceIWiktionaryDataHandler
-