@Override
 public boolean canWrap(Node node, EnhGraph eg) {
   // node will support being an TransitiveProperty facet if it has rdf:type
   // owl:TransitiveProperty or equivalent
   Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null;
   return (profile != null) && profile.isSupported(node, eg, TransitiveProperty.class);
 }
示例#2
0
        /** Return true iff the node can be converted to an instance of this class (Thing) */
        public boolean canWrap(Node n, EnhGraph eg) {
          Profile profile;
          if (eg instanceof OntModel) profile = ((OntModel) eg).getProfile();
          else return false;

          if (!profile.isSupported(n, eg, Individual.class)) {
            return false;
          }

          Graph graph = eg.asGraph();
          return graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Thing.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.String.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Phrase.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Word.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.StopWord.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Sentence.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.OffsetBasedString.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.ContextHashBasedString.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Document.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Topic.asNode())
              || graph.contains(
                  n,
                  com.hp.hpl.jena.vocabulary.RDF.type.asNode(),
                  eu.lod2.nlp2rdf.schema.tools.Vocabulary.Error.asNode());
        }