本文整理汇总了Java中org.openrdf.model.Model.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Model.isEmpty方法的具体用法?Java Model.isEmpty怎么用?Java Model.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openrdf.model.Model
的用法示例。
在下文中一共展示了Model.isEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: objectSelectedActionPerformed
import org.openrdf.model.Model; //导入方法依赖的package包/类
/**
* Method objectSelectedActionPerformed. Dictates what actions to take when an
* Action Event is performed.
*
* @param arg0 ActionEvent - The event that triggers the actions in the
* method.
*/
private void objectSelectedActionPerformed( int index ) {
UriComboBox subjectCB = subjectComboBoxes.get( index );
UriComboBox relCB = relationComboBoxes.get( index );
UriComboBox objectCB = objectComboBoxes.get( index );
StructureManager sm = StructureManagerFactory.getStructureManager( getEngine() );
Model model = sm.getLinksBetween( subjectCB.getSelectedUri(),
objectCB.getSelectedUri() );
Set<URI> values = new HashSet<>( model.predicates() );
if ( model.isEmpty() ) {
values.add( Constants.ANYNODE );
}
relCB.setEditable( false );
relCB.setData( Utility.getInstanceLabels( values, getEngine() ) );
dialog.pack();
}
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:26,代码来源:ExportSpecificRelationshipsToLoadingSheetAction.java
示例2: getPotUri
import org.openrdf.model.Model; //导入方法依赖的package包/类
/**
* @param potUriMap
* @param plantId
* @param nextProjectID
* @param nextTrayURI
* @return
* @throws PoddClientException
* @throws GraphUtilException
*/
private URI getPotUri(final ConcurrentMap<String, ConcurrentMap<URI, URI>> potUriMap, final String plantId,
final InferredOWLOntologyID nextProjectID, final URI nextTrayURI) throws PoddClientException,
GraphUtilException
{
URI nextPotURI;
if(potUriMap.containsKey(plantId))
{
nextPotURI = potUriMap.get(plantId).keySet().iterator().next();
}
else
{
final Model plantIdSparqlResults =
this.doSPARQL(String.format(ExampleSpreadsheetConstants.TEMPLATE_SPARQL_BY_TYPE_LABEL_STRSTARTS,
RenderUtils.escape(plantId), RenderUtils.getSPARQLQueryString(PODD.PODD_SCIENCE_POT)),
Arrays.asList(nextProjectID));
if(plantIdSparqlResults.isEmpty())
{
this.log.debug(
"Could not find an existing container for pot barcode, assigning a temporary URI: {} {}",
plantId, nextProjectID);
nextPotURI =
RestletPoddClientImpl.vf.createURI(RestletPoddClientImpl.TEMP_UUID_PREFIX + "pot:"
+ UUID.randomUUID().toString());
}
else
{
nextPotURI = GraphUtil.getUniqueSubjectURI(plantIdSparqlResults, RDF.TYPE, PODD.PODD_SCIENCE_POT);
}
ConcurrentMap<URI, URI> nextPotUriMap = new ConcurrentHashMap<>();
final ConcurrentMap<URI, URI> putIfAbsent2 = potUriMap.putIfAbsent(plantId, nextPotUriMap);
if(putIfAbsent2 != null)
{
nextPotUriMap = putIfAbsent2;
}
nextPotUriMap.put(nextPotURI, nextTrayURI);
}
return nextPotURI;
}
示例3: getTrayUri
import org.openrdf.model.Model; //导入方法依赖的package包/类
/**
* @param trayUriMap
* @param trayId
* @param nextProjectID
* @param nextExperimentUri
* @return
* @throws PoddClientException
* @throws GraphUtilException
*/
private URI getTrayUri(final ConcurrentMap<String, ConcurrentMap<URI, URI>> trayUriMap, final String trayId,
final InferredOWLOntologyID nextProjectID, final URI nextExperimentUri) throws PoddClientException,
GraphUtilException
{
// Check whether trayId already has an assigned URI
URI nextTrayURI;
if(trayUriMap.containsKey(trayId))
{
nextTrayURI = trayUriMap.get(trayId).keySet().iterator().next();
}
else
{
final Model trayIdSparqlResults =
this.doSPARQL(String.format(ExampleSpreadsheetConstants.TEMPLATE_SPARQL_BY_TYPE_LABEL_STRSTARTS,
RenderUtils.escape(trayId), RenderUtils.getSPARQLQueryString(PODD.PODD_SCIENCE_TRAY)),
Arrays.asList(nextProjectID));
if(trayIdSparqlResults.isEmpty())
{
this.log.debug(
"Could not find an existing container for tray barcode, assigning a temporary URI: {} {}",
trayId, nextProjectID);
nextTrayURI =
RestletPoddClientImpl.vf.createURI(RestletPoddClientImpl.TEMP_UUID_PREFIX + "tray:"
+ UUID.randomUUID().toString());
}
else
{
nextTrayURI = GraphUtil.getUniqueSubjectURI(trayIdSparqlResults, RDF.TYPE, PODD.PODD_SCIENCE_TRAY);
}
ConcurrentMap<URI, URI> nextTrayUriMap = new ConcurrentHashMap<>();
final ConcurrentMap<URI, URI> putIfAbsent2 = trayUriMap.putIfAbsent(trayId, nextTrayUriMap);
if(putIfAbsent2 != null)
{
nextTrayUriMap = putIfAbsent2;
}
nextTrayUriMap.put(nextTrayURI, nextExperimentUri);
}
return nextTrayURI;
}
示例4: populateGenotypeUriMap
import org.openrdf.model.Model; //导入方法依赖的package包/类
private void populateGenotypeUriMap(
final ConcurrentMap<String, ConcurrentMap<URI, InferredOWLOntologyID>> projectUriMap,
final ConcurrentMap<URI, ConcurrentMap<URI, Model>> genotypeUriMap) throws PoddClientException
{
for(final String nextProjectName : projectUriMap.keySet())
{
final ConcurrentMap<URI, InferredOWLOntologyID> nextProjectNameMapping = projectUriMap.get(nextProjectName);
for(final URI projectUri : nextProjectNameMapping.keySet())
{
final InferredOWLOntologyID artifactId = nextProjectNameMapping.get(projectUri);
final Model nextSparqlResults =
this.doSPARQL(String.format(ExampleSpreadsheetConstants.TEMPLATE_SPARQL_BY_TYPE_ALL_PROPERTIES,
RenderUtils.getSPARQLQueryString(PODD.PODD_SCIENCE_GENOTYPE)), Arrays
.asList(artifactId));
if(nextSparqlResults.isEmpty())
{
this.log.debug("Could not find any existing genotypes for project: {} {}", nextProjectName,
projectUri);
}
for(final Resource nextGenotype : nextSparqlResults.filter(null, RDF.TYPE, PODD.PODD_SCIENCE_GENOTYPE)
.subjects())
{
if(!(nextGenotype instanceof URI))
{
this.log.error("Found genotype that was not assigned a URI: {} artifact={}", nextGenotype,
artifactId);
}
else
{
ConcurrentMap<URI, Model> nextGenotypeMap = new ConcurrentHashMap<>();
final ConcurrentMap<URI, Model> putIfAbsent = genotypeUriMap.put(projectUri, nextGenotypeMap);
if(putIfAbsent != null)
{
nextGenotypeMap = putIfAbsent;
}
final Model putIfAbsent2 = nextGenotypeMap.putIfAbsent((URI)nextGenotype, nextSparqlResults);
if(putIfAbsent2 != null)
{
this.log.info("Found existing description for genotype URI within the same project: {} {}",
projectUri, nextGenotype);
}
}
}
}
}
}