本文整理汇总了Java中org.LexGrid.commonTypes.Source类的典型用法代码示例。如果您正苦于以下问题:Java Source类的具体用法?Java Source怎么用?Java Source使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Source类属于org.LexGrid.commonTypes包,在下文中一共展示了Source类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNCImCodes
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public Vector getNCImCodes(Entity node) {
if (node == null) return null;
Vector w = new Vector();
Property[] props = node.getAllProperties();
for (int i = 0; i < props.length; i++) {
Property prop = props[i];
PropertyQualifier[] qualifiers = prop.getPropertyQualifier();
for (int k=0; k<qualifiers.length; k++) {
PropertyQualifier qualifier = qualifiers[k];
}
Source[] sources = prop.getSource();
for (int k=0; k<sources.length; k++) {
Source source = sources[k];
}
if (Arrays.asList(NCIM_CODE_PROPERTYIES).contains(prop.getPropertyName())) {
if (!w.contains(prop.getValue().getContent())) {
w.add(prop.getValue().getContent());
}
}
}
return w;
}
示例2: getNCImCodes
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public static Vector getNCImCodes(Entity node) {
if (node == null) return null;
Vector w = new Vector();
Property[] props = node.getAllProperties();
for (int i = 0; i < props.length; i++) {
Property prop = props[i];
PropertyQualifier[] qualifiers = prop.getPropertyQualifier();
for (int k=0; k<qualifiers.length; k++) {
PropertyQualifier qualifier = qualifiers[k];
}
Source[] sources = prop.getSource();
for (int k=0; k<sources.length; k++) {
Source source = sources[k];
}
if (Arrays.asList(Constants.NCIM_CODE_PROPERTYIES).contains(prop.getPropertyName())) {
if (!w.contains(prop.getValue().getContent())) {
w.add(prop.getValue().getContent());
}
}
}
return w;
}
示例3: getValueSetDefinitionsBySource
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public Vector getValueSetDefinitionsBySource(String source) {
if (_availableValueSetDefinitionSources != null) {
if (!_availableValueSetDefinitionSources.contains(source)) return null;
}
Vector v = new Vector();
List list = valueSetDefinitionURIList;
if (list == null) return null;
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = findValueSetDefinitionByURI(uri);
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
boolean found = false;
while (sourceEnum.hasMoreElements()) {
Source src = (Source) sourceEnum.nextElement();
String src_str = src.getContent();
if (src_str.compareTo(source) == 0) {
v.add(vsd);
break;
}
}
}
return v;
}
示例4: findAvailableValueSetDefinitionSources
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public Vector findAvailableValueSetDefinitionSources() {
Vector v = new Vector();
HashSet hset = new HashSet();
List list = valueSetDefinitionURIList;
if (list == null) return null;
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = findValueSetDefinitionByURI(uri);
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
while (sourceEnum.hasMoreElements()) {
Source src = (Source) sourceEnum.nextElement();
String src_str = src.getContent();
if (!hset.contains(src_str)) {
hset.add(src_str);
v.add(src_str);
}
}
}
return v;
}
示例5: getNCImCodes
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public Vector getNCImCodes(Entity node) {
if (node == null) return null;
Vector w = new Vector();
Property[] props = node.getAllProperties();
for (int i = 0; i < props.length; i++) {
Property prop = props[i];
PropertyQualifier[] qualifiers = prop.getPropertyQualifier();
for (int k=0; k<qualifiers.length; k++) {
PropertyQualifier qualifier = qualifiers[k];
}
Source[] sources = prop.getSource();
for (int k=0; k<sources.length; k++) {
Source source = sources[k];
}
if (Arrays.asList(Constants.NCIM_CODE_PROPERTYIES).contains(prop.getPropertyName())) {
if (!w.contains(prop.getValue().getContent())) {
w.add(prop.getValue().getContent());
}
}
}
return w;
}
示例6: toProperty
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
/**
* Create a property qualifier from a lexevs org.LexGrid.commonTypes.Source
* @param source
* @return Property
*/
private Property toProperty(org.LexGrid.commonTypes.Source source) {
Property cts2Prop = new Property();
String predicateUri = EntityConstants.ENTITY_PREDICATE_BASE_URI +
EntityConstants.ENTITY_PREDICATE_URI_PROPERTY_SOURCE;
PredicateReference ref = new PredicateReference();
ref.setName(EntityConstants.ENTITY_PREDICATE_URI_PROPERTY_SOURCE);
ref.setNamespace(EntityConstants.ENTITY_NAME_SPACE);
ref.setUri(predicateUri);
cts2Prop.setPredicate(ref);
StatementTarget target = new StatementTarget();
target.setLiteral(
ModelUtils.createOpaqueData(source.getContent()));
cts2Prop.addValue(target);
return cts2Prop;
}
示例7: getValueSetDecriptionSources
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public static Vector getValueSetDecriptionSources(String uri) {
/*
if (_valueSetDefinitionURI2VSD_map == null) {
_valueSetDefinitionURI2VSD_map = getValueSetDefinitionURI2VSD_map();
}
*/
Vector source_vec = new Vector();
ValueSetDefinition vsd = (ValueSetDefinition) _valueSetDefinitionURI2VSD_map.get(uri);
if (vsd == null) return null;
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
while (sourceEnum.hasMoreElements()) {
Source source = (Source) sourceEnum.nextElement();
String src_str = source.getContent();
source_vec.add(src_str);
}
return source_vec;
}
示例8: getValueSetDefinitionsBySource
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public static Vector getValueSetDefinitionsBySource(String source) {
if (_availableValueSetDefinitionSources != null) {
if (!_availableValueSetDefinitionSources.contains(source)) return null;
}
Vector v = new Vector();
LexEVSValueSetDefinitionServices vsd_service = RemoteServerUtil.getLexEVSValueSetDefinitionServices();
List list = vsd_service.listValueSetDefinitionURIs();
if (list == null) return null;
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = findValueSetDefinitionByURI(uri);
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
boolean found = false;
while (sourceEnum.hasMoreElements()) {
Source src = (Source) sourceEnum.nextElement();
String src_str = src.getContent();
if (src_str.compareTo(source) == 0) {
v.add(vsd);
break;
}
}
}
return v;
}
示例9: getSynonyms
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public static Vector getSynonyms(Entity concept) {
if (concept == null)
return null;
Vector v = new Vector();
Presentation[] properties = concept.getPresentation();
int n = 0;
for (int i = 0; i < properties.length; i++) {
Presentation p = properties[i];
String term_name = p.getValue().getContent();
String term_type = "null";
String term_source = "null";
String term_source_code = "null";
PropertyQualifier[] qualifiers = p.getPropertyQualifier();
if (qualifiers != null) {
for (int j = 0; j < qualifiers.length; j++) {
PropertyQualifier q = qualifiers[j];
String qualifier_name = q.getPropertyQualifierName();
String qualifier_value = q.getValue().getContent();
if (qualifier_name.compareTo("source-code") == 0) {
term_source_code = qualifier_value;
break;
}
}
}
term_type = p.getRepresentationalForm();
Source[] sources = p.getSource();
if (sources != null && sources.length > 0) {
Source src = sources[0];
term_source = src.getContent();
}
v.add(term_name + "|" + term_type + "|" + term_source + "|"
+ term_source_code);
}
SortUtils.quickSort(v);
return v;
}
示例10: getValueSetDefinitionsBySource
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public static Vector getValueSetDefinitionsBySource(String source) {
if (_availableValueSetDefinitionSources != null) {
if (!_availableValueSetDefinitionSources.contains(source)) return null;
}
Vector v = new Vector();
LexEVSValueSetDefinitionServices vsd_service = RemoteServerUtil.getLexEVSValueSetDefinitionServices();
if (vsd_service == null) {
System.out.println("Unable to instantiate LexEVSValueSetDefinitionServices???");
return null;
}
List list = vsd_service.listValueSetDefinitionURIs();
if (list == null) return null;
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = findValueSetDefinitionByURI(uri);
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
boolean found = false;
while (sourceEnum.hasMoreElements()) {
Source src = (Source) sourceEnum.nextElement();
String src_str = src.getContent();
if (src_str.compareTo(source) == 0) {
v.add(vsd);
break;
}
}
}
return v;
}
示例11: getAvailableValueSetDefinitionSources
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public static Vector getAvailableValueSetDefinitionSources() {
if (_availableValueSetDefinitionSources != null) return _availableValueSetDefinitionSources;
Vector availableValueSetDefinitionSources = new Vector();
HashSet hset = new HashSet();
LexEVSValueSetDefinitionServices vsd_service = RemoteServerUtil.getLexEVSValueSetDefinitionServices();
if (vsd_service == null) {
System.out.println("Unable to instantiate LexEVSValueSetDefinitionServices???");
return null;
}
List list = vsd_service.listValueSetDefinitionURIs();
if (list == null) return null;
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = findValueSetDefinitionByURI(uri);
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
while (sourceEnum.hasMoreElements()) {
Source src = (Source) sourceEnum.nextElement();
String src_str = src.getContent();
if (!hset.contains(src_str)) {
hset.add(src_str);
availableValueSetDefinitionSources.add(src_str);
}
}
}
return SortUtils.quickSort(availableValueSetDefinitionSources);
}
示例12: dumpProperty
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public void dumpProperty(Property property) {
System.out.println("\n" + property.getPropertyType());
System.out.println(property.getPropertyName() + ": " + property.getValue().getContent());
PropertyQualifier[] qualifiers = property.getPropertyQualifier();
if (qualifiers != null) {
System.out.println("Property Qualifiers: " );
for (int i=0; i<qualifiers.length; i++) {
PropertyQualifier qualifier = qualifiers[i];
System.out.println("\t" + qualifier.getPropertyQualifierName() + ": " + qualifier.getValue().getContent());
}
}
Source[] sources = property.getSource();
if (sources != null) {
System.out.println("Sources: " );
for (int i=0; i<sources.length; i++) {
Source source = sources[i];
System.out.println("\t" + source.getContent());
}
}
if (property instanceof Presentation) {
Presentation presentation = (Presentation) property;
if (presentation.getRepresentationalForm() != null) {
System.out.println("RepresentationalForm: " + presentation.getRepresentationalForm());
}
}
}
示例13: getValueSetDecriptionSources
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public Vector getValueSetDecriptionSources(String uri) {
Vector source_vec = new Vector();
ValueSetDefinition vsd = (ValueSetDefinition) _valueSetDefinitionURI2VSD_map.get(uri);
if (vsd == null) return null;
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
while (sourceEnum.hasMoreElements()) {
Source source = (Source) sourceEnum.nextElement();
String src_str = source.getContent();
source_vec.add(src_str);
}
return source_vec;
}
示例14: createVSDSource2VSDsMap
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
public HashMap createVSDSource2VSDsMap() {
HashMap vsd_source_to_vsds_map = new HashMap();
//LexEVSValueSetDefinitionServices vsd_service = RemoteServerUtil.getLexEVSValueSetDefinitionServices();
List list = valueSetDefinitionURIList;
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = findValueSetDefinitionByURI(uri);
String vsd_uri = vsd.getValueSetDefinitionURI();
java.util.Enumeration<? extends Source> sourceEnum = vsd.enumerateSource();
while (sourceEnum.hasMoreElements()) {
Source source = (Source) sourceEnum.nextElement();
String src_str = source.getContent();
Vector vsd_vec = new Vector();
if (vsd_source_to_vsds_map.containsKey(src_str)) {
vsd_vec = (Vector) vsd_source_to_vsds_map.get(src_str);
}
boolean found = false;
for (int j=0; j<vsd_vec.size(); j++) {
ValueSetDefinition next_vsd = (ValueSetDefinition) vsd_vec.elementAt(j);
if (next_vsd.getValueSetDefinitionURI().compareTo(vsd_uri) == 0) {
found = true;
break;
}
}
if (!found) {
vsd_vec.add(vsd);
}
vsd_source_to_vsds_map.put(src_str, vsd_vec);
}
}
return vsd_source_to_vsds_map;
}
示例15: isNCIDefinition
import org.LexGrid.commonTypes.Source; //导入依赖的package包/类
private boolean isNCIDefinition(Definition definition) {
Source[] sources = definition.getSource();
if (sources != null && sources.length > 0) {
for (Source defSource: sources) {
if (defSource.getContent().equalsIgnoreCase("NCI")) {
return true;
}
}
}
return false;
}